NXLog

NXLog

Ship logs from NXLog over syslog TLS, TCP SSL or HTTPS JSON

Use NXLog Agent to collect log files and forward them to your Logit.io Logs stack. NXLog Agent can send over three routes that map to existing Logit.io inputs: syslog over TLS to a Syslog SSL input, JSON over TLS to a TCP SSL input or JSON over HTTPS to the HTTPS JSON API.

Logs

Install integration

Please click on the Install Integration button to configure your stack for this source.

Choose a route

RouteNXLog output moduleLogit.io input
Syslog TLSom_ssl with to_syslog_bsd()Syslog SSL input. Same transport as the RSyslog and Syslog-NG pages.
TCP SSLom_ssl with to_json()TCP SSL input. The example sends one JSON object per line.
HTTPS JSONom_http with to_json()/v2 endpoint. One API key authenticates each request.

The snippets are for NXLog Agent, not NXLog Community Edition. Change the im_file input to your own log files. The directives come from the NXLog Agent reference for om_ssl (opens in a new tab), om_http (opens in a new tab), xm_syslog (opens in a new tab) and xm_json (opens in a new tab). Check them against the version of NXLog Agent you run. Community Edition uses a separate Port directive instead of host:port in Host, and its om_http module has no Compression or AddHeader directive.

Download the Logit.io root certificate

The om_ssl examples validate the connection with the Logit.io root certificate, as the RSyslog page does. Download it to the NXLog configuration directory. Change the path in CAFile if you save it elsewhere, for example on Windows.

sudo curl -o /etc/nxlog/root.logit.io.crt https://cdn.logit.io/root.logit.io.crt

Configure NXLog

Add the matching blocks to nxlog.conf.

The host and Syslog SSL port populate in the example when you sign in and select a stack. If the stack has no Syslog SSL input yet, add one.

nxlog.conf
<Extension syslog>
    Module xm_syslog
</Extension>

<Input app_logs>
    Module im_file
    File   "/var/log/app/*.log"
</Input>

<Output logit_syslog>
    Module         om_ssl
    Host           @logstash.host:@logstash.sslPort
    CAFile         /etc/nxlog/root.logit.io.crt
    AllowUntrusted FALSE
    Exec           $Message = $raw_event; to_syslog_bsd();
</Output>

<Route logs_to_logit>
    Path app_logs => logit_syslog
</Route>

to_syslog_bsd() writes BSD syslog, the format the RSyslog and Syslog-NG pages also send. CAFile points at the Logit.io root certificate, which you downloaded in the previous step. This is the certificate the RSyslog page uses to validate the connection.

Restart NXLog

Restart the NXLog service so it reads the new configuration, then check the NXLog log file for connection or syntax errors.

sudo systemctl restart nxlog

For HTTPS JSON, om_http treats HTTP 200, 201 and 202 as success. The API returns HTTP 202 when it has queued the event. NXLog retries other responses by default until they succeed.

Windows event logs

To ship Windows Event Log, use the Winlogbeat integration. Hosted Logstash has routing and an ingest pipeline for Winlogbeat events. NXLog events arrive as the JSON or syslog that you send, and this page does not describe any built-in parsing for them.

Launch OpenSearch Dashboards to view your data

Launch OpenSearch Dashboards

How to diagnose no data in your stack

If you don't see data appearing in your stack after following this integration, take a look at the troubleshooting guide for steps to diagnose and resolve the problem or contact our support team and we'll be happy to assist.

Related guides