• Products
    LOG COLLECTOR
    NXLog Enterprise Edition
    Full feature multi-platform log collection
    NXLog Community Edition
    Open-source free log collector
    ADD-ONS FOR NXLOG ENTERPRISE EDITION
    NXLog Add-Ons
    Integration with various software
    AGENT MANAGER FOR NXLOG ENTERPRISE EDITION
    NXLog Manager
    Manage and monitor NXLog instances
    NXLog Minder
    Hyper-scalable, API-first agent management
    DATABASE FOR NXLOG ENTERPRISE EDITION
    Raijin Database Engine
    The schemaless SQL database for storing events
    more from nxlog
    Professional Services
    Compare NXLog EE and CE
  • Downloads
    NXLog Enterprise Edition
    Full feature multi-platform log collection
    NXLog Manager
    Manage and monitor NXLog instances
    NXLog Community Edition
    Open-source free log collector
  • Solutions
    Integrations
    With SIEM, Devices, SaaS...
    Specfic OS support
    AIX, Linux, FreeBSD
    SCADA/ICS
    Energy, Oil & Gas, Transport...
    Windows Event log
    Collect locally or remotely, ..
    DNS Logging
    Enterprise-grade DNS log...
    Log Collection Modes
    Agent-based, Agentless or Cloud
    Agent Management
    Agents management and monitoring
    FIM
    File Integrity Monitoring
    macOS Logging
    ULS events, Apple System Logs ...

    By Industry

    Financial Services
    Government & Education
    Entertainment & Gambling
    Telecommunications
    Medical & Healthcare
    Military & Defense
    Law Firms & Legal Counsel
    Industrial & Manufacturing
  • Partners
    Find a Reseller
    Look for our resellers worldwide
    Technology Ecosystem
    See all our partners and integrations
    Partner Program
    Join our community of partners
    Partner Portal →
  • Resources
    Documentation
    Products guides and integrations
    Blog
    Tutorials, updates and releases
    White papers
    Datasheets, infographics and more
    Videos
    Trainings and tutorial on specific topics
    Webinars
    Community events and webinars
    Community Forum →
  • Support
  • Why Nxlog
    About Us
    Our journey, team and mission
    Customers
    Testimonials and case studies
    Careers
    We are hiring!
    Contact Us →
Log In Sign Up
Request Trial
LOG COLLECTOR
NXLog Enterprise Edition
Full feature multi-platform log collection
NXLog Community Edition
Open-source free log collector
ADD-ONS FOR NXLOG ENTERPRISE EDITION
NXLog Add-Ons
Integration with various software
AGENT MANAGER FOR NXLOG ENTERPRISE EDITION
NXLog Manager
Manage and monitor NXLog instances
NXLog Minder
Hyper-scalable, API-first agent management
DATABASE FOR NXLOG ENTERPRISE EDITION
Raijin Database Engine
The schemaless SQL database for storing events
more from nxlog
Professional Services
Compare NXLog EE and CE
NXLog Enterprise Edition
Full feature multi-platform log collection
NXLog Manager
Manage and monitor NXLog instances
NXLog Community Edition
Open-source free log collector
Integrations
With SIEM, Devices, SaaS...
Specfic OS support
AIX, Linux, FreeBSD
SCADA/ICS
Energy, Oil & Gas, Transport...
Windows Event log
Collect locally or remotely, ..
DNS Logging
Enterprise-grade DNS log...
Log Collection Modes
Agent-based, Agentless or Cloud
Agent Management
Agents management and monitoring
FIM
File Integrity Monitoring
macOS Logging
ULS events, Apple System Logs ...

By Industry

Financial Services
Government & Education
Entertainment & Gambling
Telecommunications
Medical & Healthcare
Military & Defense
Law Firms & Legal Counsel
Industrial & Manufacturing
Find a Reseller
Look for our resellers worldwide
Technology Ecosystem
See all our partners and integrations
Partner Program
Join our community of partners
Partner Portal →
Documentation
Products guides and integrations
Blog
Tutorials, updates and releases
White papers
Datasheets, infographics and more
Videos
Trainings and tutorial on specific topics
Webinars
Community events and webinars
Community Forum →
Support
About Us
Our journey, team and mission
Customers
Testimonials and case studies
Careers
We are hiring!
Contact Us →
  • Loading...
Request Trial
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 Ltd. develops multi-platform log collection tools that support many different log sources, formats, transports, and integrations. The tools help administrators collect, parse, and forward logs so they can more easily respond to security issues, investigate operational problems, and analyze event data. NXLog distributes the free and open source NXLog Community Edition and offers additional features and support with the NXLog Enterprise Edition.

This document is provided for informational purposes only and is subject to change without notice. Trademarks are the properties of their respective owners.

  • nxlog configuration
Share

Facebook Twitter LinkedIn Reddit Mail
Related Posts

Making the most of Windows Event Forwarding for centralized log collection
7 minutes | December 17, 2018
DNS Log Collection - Part 2
9 minutes | May 28, 2020
Windows Event Log collection in a nutshell
4 minutes | June 14, 2021

Stay connected:

Sign up

Keep up to date with our weekly 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 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

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

© Copyright 2023 NXLog Ltd.

PRIVACY POLICY TERMS OF USE

  • PRODUCTS

  • NXLOG ENTERPRISE EDITION
  • NXLOG COMMUNITY EDITION
  • NXLOG ADD-ONS
  • NXLOG MANAGER
  • NXLOG MINDER
  • RAIJIN DATABASE
  • MORE NXLOG

  • COMPARE SOLUTIONS
  • INDUSTRIES
  • INTERGRATIONS
  • FIND A RESELLER
  • PARTNER PROGRAM
  • RESOURCES

  • DOCUMENTATION
  • WHITE PAPERS
  • WEBINARS
  • TUTORIALS
  • BLOG
  • COMMUNITY FORUM
  • ABOUT US

  • WHY NXLOG
  • CUSTOMERS
  • CAREERS
  • CONTACT US
  • DOWNLOADS

  • NXLOG ENTERPRISE EDITION
  • NXLOG COMMUNITY EDITION
  • NXLOG MINDER
  • NXLOG MANAGER
  • NXLOG ADD-ONS
  • RAIJIN DATABASE