- OS Support
- Enterprise Edition Reference Manual
- 136. Man Pages
- 137. Configuration
- 138. Language
- 139. Extension Modules
- 140. Input Modules
- 141. Processor Modules
- 142. Output Modules
- 142.1. Microsoft Azure (om_azure)
- 142.2. Batched compression (om_batchcompress)
- 142.3. Blocker (om_blocker)
- 142.4. DBI (om_dbi)
- 142.5. Elasticsearch (om_elasticsearch)
- 142.6. EventDB (om_eventdb)
- 142.7. Program (om_exec)
- 142.8. File (om_file)
- 142.9. Go (om_go)
- 142.10. HTTP(s) (om_http)
- 142.11. Java (om_java)
- 142.12. Kafka (om_kafka)
- 142.13. Null (om_null)
- 142.14. ODBC (om_odbc)
- 142.15. Perl (om_perl)
- 142.16. Named pipes (om_pipe)
- 142.17. Python (om_python)
- 142.18. Raijin (om_raijin)
- 142.19. Redis (om_redis)
- 142.20. Ruby (om_ruby)
- 142.21. TLS/SSL (om_ssl)
- 142.22. TCP (om_tcp)
- 142.23. UDP (om_udp)
- 142.24. UDP with IP spoofing (om_udpspoof)
- 142.25. Unix domain sockets (om_uds)
- 142.26. WebHDFS (om_webhdfs)
- 142.27. ZeroMQ (om_zmq)
- NXLog Manager
- NXLog Add-Ons
This module will execute a program or script on startup and write
(pipe) log data to its standard input. Unless
OutputType is set to something else,
only the contents of the
$raw_event field are sent over the
pipe. The execution of the program or script will terminate when the
module is stopped, which usually happens when NXLog exits and
the pipe is closed.
|To examine the supported platforms, see the list of installer packages in the Available Modules chapter.|
|The program or script is started when NXLog starts and must not exit until the module is stopped. To invoke a program or script for each log message, use xm_exec instead.|
This mandatory directive specifies the name of the program or script to be executed.Note
Programs, scripts, and commands are executed under the context of the user running NXLog. When NXLog is running as a service, the service user will be used. If the program, script, or command accesses environment variables, make sure that these are available for the NXLog user.
Restart the process if it exits. There is a one second delay before it is restarted to avoid a denial-of-service when a process is not behaving. Looping should be implemented in the script itself. This directive is only to provide some safety against malfunctioning scripts and programs. This boolean directive defaults to FALSE: the Command will not be restarted if it exits.
This configuration reads logs from a file and writes the log lines to the standard input of an application. The Command directive specifies the path to the application executable and the Arg directive specifies an application argument.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <Input log_file> Module im_file File '/path/to/log/file' </Input> <Output myapp> Module om_exec Command /path/to/myapp # On Windows the path to the application executable # should include the file extension. #Command C:\Program Files\MyApp\myapp.exe Arg --level=info </Output>
This configuration reads logs from a file and writes the log lines to the
standard output using the Linux
cat command-line tool.
The Command directive specifies the
path to the Linux system shell. The first Arg directive
-c argument to the shell and the second Arg directive specifies
the command to execute.
This configuration reads logs from a file and pipes the log lines to a Python script. The Command directive specifies the path to the Python executable and the Arg directive specifies the path to the script.
To execute commands under a specific shell, the Command directive should specify the path to the shell executable. The commands to execute can be passed as arguments according to the shell being used. The configuration below executes PowerShell commands from a file.