News and blog
NXLog main page
  • Products
    NXLog Platform
    Log collection
    Log management and analytics
    Log storage
    NXLog Community Edition
    Integrations
    Professional Services
  • Solutions
    Use cases
    Specific OS support
    SCADA/ICS
    Windows event log
    DNS logging
    MacOS logging
    Solutions by industry
    Financial Services
    Government & Education
    Entertainment & Gambling
    Telecommunications
    Medical & Healthcare
    Military & Defense
    Law Firms & Legal Counsel
    Industrial & Manufacturing
  • Plans
  • Partners
    Find a Reseller
    Partner Program
  • Resources
    Documentation
    Blog
    White papers
    Videos
    Webinars
    Case Studies
    Community Program
    Community Forum
  • About
    Company
    Careers
  • Support
    Support portals
    Contact us

NXLog Platform
Log collection
Log management and analytics
Log storage
NXLog Community Edition
Integrations
Professional Services

Use Cases
Specific OS support
SCADA/ICS
Windows event log
DNS logging
MacOS logging
Solutions by industry
Financial Services
Government & Education
Entertainment & Gambling
Telecommunications
Medical & Healthcare
Military & Defense
Law Firms & Legal Counsel
Industrial & Manufacturing


Find a Reseller
Partner Program

Documentation
Blog
White papers
Videos
Webinars
Case Studies
Community Program
Community Forum

Company
Careers

Support portals
Contact us
Let's Talk Start free
NXLog search
  • Loading...
Let's Talk Start free
September 25, 2021 configurationagentdeployment

Putting together your first NXLog configuration

By John Kirch

Share
ALL SIEM STRATEGY SECURITY ANNOUNCEMENT DEPLOYMENT COMPLIANCE COMPARISON RSS

If you are reading this, then it is safe to say that you are now part of the NXLog community. In other words, you are ready to dive into the world of log collection. Excellent. You have made a great choice. However, before you start collecting logs you should know just how your NXLog log collection tool works.

The NXLog log collection tool uses loadable modules that are invoked within the input, data modification, and output stages. Because you can choose which modules to use in your NXLog configuration file, this provides countless possibilities for collecting logs based on your organization’s needs. Input modules work by reading your log data from various sources, whether these sources are on a remote server or found in a local directory. Output modules save your logs to a specific destination. And lastly, extension modules provide data transformation or parsing capabilities. The path these events take from the input to output block(s) is called the route.

Let’s bring all these pieces together in a simple and quick configuration guide. Windows will be the operating system featured in this blog post, so you can go ahead and download the Windows installer package. Already installed? Perfect. Let’s get started.

NXLog configuration steps

The first step is opening your NXLog configuration file which you will find in the C:\Program Files\nxlog directory of your Windows system. You will notice that your configuration file comes with default settings for advanced options. However, for this simple guide, we do not need them. We will start by setting up our log source, or in other words, our input. Here, we introduce the modules that provide the functionality to collect logs. In this scenario, our log source will be the security channel of Windows Event Log and we will use the im_msvistalog module to collect our events. To load an instance of this module, we will need to choose an instance name, because it possible to load more than one instance of a module. We will call our input instance input_events.

nxlog.conf input instance
<Input input_events>
    Module  im_msvistalog
    <QueryXML>
        <QueryList>
            <Query Id='0'>
                <Select Path='Security'>*</Select>
            </Query>
        </QueryList>
    </QueryXML>
</Input>

On the next line, we use the Module directive to define which module NXLog should load. Because this particular module supports XPath, a query language for event selection that Windows Event Log uses, we use the <QueryXML> tag to tell NXLog that this the beginning of an XPath query block. The next couple of nested block tags support defining multiple queries. The single query line we will use is based on the value we have assigned Path, which in our case will be the Security channel. To learn more about creating these queries you can read our guide on event log filtering.

Secondly, we define our output instance. For consistency, let’s call our output instance output_events. The name of the module that allows us to save our logs to our local directory is om_file. The File directive lets us specify the exact directory path and filename where we would like the logs to be saved. In this example, we will save them to C:\Windows\Temp\logmsg.txt.

nxlog.conf output instance
<Output output_events>
    Module  om_file
    File   'C:\Windows\Temp\logmsg.txt'
</Output>

The third step is to declare the route block. In the example below, we use the Path directive on line two (2) to clearly establish the flow of event data from the input stage to the output stage. We reference them by their instance names which function as unique identifiers.

nxlog.conf route
<Route input_events_to_output_events>
    Path            input_events => output_events
</Route>

Lastly, an important step is choosing any extension modules that might be needed for manipulating log data, be it for parsing, or for reading/writing various log log formats. Extension modules are used to extend and configure a wide range of capabilities available with the NXLog log collection tool.

nxlog.conf extension instance
<Extension json>
    Module  xm_json
</Extension>

<Input input_events>
    Module  im_msvistalog
    <QueryXML>
        <QueryList>
            <Query Id='0'>
                <Select Path='Security'>*</Select>
            </Query>
        </QueryList>
    </QueryXML>
</Input>

<Output output_events>
    Module  om_file
    Exec    to_json();
    File   'C:\Windows\Temp\logmsg.txt'
</Output>

<Route input_events_to_output_events>
    Path            input_events => output_events
</Route>

In the example above, we parse the security logs collected from Windows Event Log to JSON (JavaScript Object Notation), by using the to_json() procedure, in our output instance. This is facilitated by first loading the xm_json extension module. In order to load this module, we define the json instance shown in the first three lines of our finalized configuration listed above. Now, when we navigate to C:\Windows\Temp\logmsg.txt we will observe that our logs have arrived in JSON format as expected.

Output Sample
{
  "EventTime": "2021-09-09T18:57:15.765021+03:00",
  "Hostname": "DESKTOP-I9CD588",
  "Keywords": "9232379236109516800",
  "LevelValue": 0,
  "EventType": "AUDIT_SUCCESS",
  "SeverityValue": 2,
  "Severity": "INFO",
  "EventID": 4624,
  "SourceName": "Microsoft-Windows-Security-Auditing",
  "ProviderGuid": "{54849625-5478-4994-A5BA-3E3B0328C30D}",
  "Version": 2,
  "TaskValue": 12544,
  "OpcodeValue": 0,
  "RecordNumber": 70830,
  "ActivityID": "{BC138851-A54F-000E-5888-13BC4FA5D701}",
  "ExecutionProcessID": 916,
  "ExecutionThreadID": 5208,
  "Channel": "Security",
  "Message": "An account was successfully logged on.\r\n\r\nS ",
  "Category": "Logon",
  "Opcode": "Info",
  "Level": "Information",
  "SubjectUserSid": "S-1-5-18",
  "SubjectUserName": "DESKTOP-I9CD588$",
  "SubjectDomainName": "WORKGROUP"
}

And there you have it! You have successfully completed your first NXLog configuration guide. With this new found knowledge, we hope that you will continue to take advantage of our powerful log collection tool that is not only lightweight and resourceful, but also flexible enough to meet a variety of your organization’s needs.

GET STARTED TODAY

CONTACT US Our experts are happy to help REQUEST A FREE TRIAL Give NXLog Enterprise Edition a try GET PRICING Request a quote
  • nxlog configuration
Share

Facebook Twitter LinkedIn Reddit Mail
Related Posts

Making the most of Windows Event Forwarding for centralized log collection
6 minutes | December 17, 2018
DNS Log Collection on Windows
8 minutes | May 28, 2020
Windows Event Log collection in a nutshell
3 minutes | June 14, 2021

Stay connected:

Sign up

Keep up to date with our monthly digest of articles.

By clicking singing up, I agree to the use of my personal data in accordance with NXLog Privacy Policy.

Featured posts

Announcing NXLog Platform 1.6
April 22, 2025
Announcing NXLog Platform 1.5
February 27, 2025
Announcing NXLog Platform 1.4
December 20, 2024
NXLog redefines log management for the digital age
December 19, 2024
2024 and NXLog - a review
December 19, 2024
Announcing NXLog Platform 1.3
October 25, 2024
NXLog redefines the market with the launch of NXLog Platform: a new centralized log management solution
September 24, 2024
Welcome to the future of log management with NXLog Platform
August 28, 2024
Announcing NXLog Enterprise Edition 5.11
June 20, 2024
Raijin announces release of version 2.1
May 31, 2024
Ingesting log data from Debian UFW to Loki and Grafana
May 21, 2024
Announcing NXLog Enterprise Edition 6.3
May 13, 2024
Raijin announces release of version 2.0
March 14, 2024
NXLog Enterprise Edition on Submarines
March 11, 2024
The evolution of event logging: from clay tablets to Taylor Swift
February 6, 2024
Migrate to NXLog Enterprise Edition 6 for our best ever log collection experience
February 2, 2024
Raijin announces release of version 1.5
January 26, 2024
2023 and NXLog - a review
December 22, 2023
Announcing NXLog Enterprise Edition 5.10
December 21, 2023
Raijin announces release of version 1.4
December 12, 2023
Announcing NXLog Enterprise Edition 6.2
December 4, 2023
Announcing NXLog Manager 5.7
November 3, 2023
Announcing NXLog Enterprise Edition 6.1
October 20, 2023
Raijin announces release of version 1.3
October 6, 2023
Upgrading from NXLog Enterprise Edition 5 to NXLog Enterprise Edition 6
September 11, 2023
Announcing NXLog Enterprise Edition 6.0
September 11, 2023
The cybersecurity challenges of modern aviation systems
September 8, 2023
Raijin announces release of version 1.2
August 11, 2023
The Sarbanes-Oxley (SOX) Act and security observability
August 9, 2023
Log Management and PCI DSS 4.0 compliance
August 2, 2023
Detect threats using NXLog and Sigma
July 27, 2023
HIPAA compliance logging requirements
July 19, 2023
Announcing NXLog Enterprise Edition 5.9
June 20, 2023
Industrial cybersecurity - The facts
June 8, 2023
Raijin announces release of version 1.1
May 30, 2023
CISO starter pack - Security Policy
May 2, 2023
Announcing NXLog Enterprise Edition 5.8
April 24, 2023
CISO starter pack - Log collection fundamentals
April 3, 2023
Raijin announces release of version 1.0
March 9, 2023
Avoid vendor lock-in and declare SIEM independence
February 13, 2023
Announcing NXLog Enterprise Edition 5.7
January 20, 2023
NXLog - 2022 in review
December 22, 2022
Need to replace syslog-ng? Changing to NXLog is easier than you think
November 23, 2022
The EU's response to cyberwarfare
November 22, 2022
Looking beyond Cybersecurity Awareness Month
November 8, 2022
GDPR compliance and log data
September 23, 2022
NXLog in an industrial control security context
August 10, 2022
Raijin vs Elasticsearch
August 9, 2022
NXLog provides native support for Google Chronicle
May 11, 2022
Aggregating macOS logs for SIEM systems
February 17, 2022
How a centralized log collection tool can help your SIEM solutions
April 1, 2020

Categories

  • SIEM
  • STRATEGY
  • SECURITY
  • ANNOUNCEMENT
  • DEPLOYMENT
  • COMPLIANCE
  • COMPARISON
logo

Subscribe to our newsletter to get the latest updates, news, and products releases. 

© Copyright 2024 NXLog FZE.

Privacy Policy. General Terms of Use

Follow us

  • Product
  • NXLog Platform 
  • Log collection
  • Log management and analysis
  • Log storage
  • Integration
  • Professional Services
  • Plans
  • Resources
  • Documentation
  • Blog
  • White papers
  • Videos
  • Webinars
  • Case studies
  • Community Program
  • Community forum
  • Support
  • Getting started guide
  • Support portals
  • About NXLog
  • About us
  • Careers
  • Find a reseller
  • Partner program
  • Contact us