Using NXLog with Elasticsearch and Kibana. Using NXLog with Elasticsearch and Kibana



Similar documents
Collecting Windows Security Audit Log data with NXLog and Sysmon. Collecting Windows Security Audit Log data with NXLog and Sysmon

Logging on a Shoestring Budget

Log management with Logstash and Elasticsearch. Matteo Dessalvi

NXLOG Community Edition Reference Manual for v

Processing millions of logs with Logstash

Log Analysis with the ELK Stack (Elasticsearch, Logstash and Kibana) Gary Smith, Pacific Northwest National Laboratory

Log managing at PIC. A. Bruno Rodríguez Rodríguez. Port d informació científica Campus UAB, Bellaterra Barcelona. December 3, 2013

Developing an Application Tracing Utility for Mule ESB Application on EL (Elastic Search, Log stash) Stack Using AOP

April 8th - 10th, 2014 LUG14 LUG14. Lustre Log Analyzer. Kalpak Shah. DataDirect Networks. ddn.com DataDirect Networks. All Rights Reserved.

Andrew Moore Amsterdam 2015

Mobile Analytics. mit Elasticsearch und Kibana. Dominik Helleberg

Using Logstash and Elasticsearch analytics capabilities as a BI tool

W3Perl A free logfile analyzer

Powering Monitoring Analytics with ELK stack

Bernd Ahlers Michael Friedrich. Log Monitoring Simplified Get the best out of Graylog2 & Icinga 2

logstash The Book Log management made easy James Turnbull

Real-time Data Analytics mit Elasticsearch. Bernhard Pflugfelder inovex GmbH

User and Programmer Guide for the FI- STAR Monitoring Service SE

Log Management with Open-Source Tools. Risto Vaarandi SEB Estonia

Log Management with Open-Source Tools. Risto Vaarandi rvaarandi 4T Y4H00 D0T C0M

Why should you look at your logs? Why ELK (Elasticsearch, Logstash, and Kibana)?

Comparative Analysis of Open-Source Log Management Solutions for Security Monitoring and Network Forensics

Efficient Management of System Logs using a Cloud Radoslav Bodó, Daniel Kouřil CESNET. ISGC 2013, March 2013

Intelligent Video Analytics. Server Installation Guide. - Windows - Linux

Using IBM dashdb With IBM Embeddable Reporting Service

logstash The Book Log management made easy James Turnbull

Installation of PHP, MariaDB, and Apache

IBM WebSphere Application Server V8.5 lab Basic Liberty profile administration using the job manager

Oracle Universal Content Management

Introduction. Background

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

LICENSE4J FLOATING LICENSE SERVER USER GUIDE

etrust Audit irecorder Reference Guide for Microsoft NT Event Log 1.5 SP2

Maintaining Non-Stop Services with Multi Layer Monitoring

How To Use Elasticsearch

TrueSight Operations Management Monitoring Studio

Ellucian Recruiter Installation and Integration. Release 4.1 December 2015

JobScheduler Web Services Executing JobScheduler commands

Web Dashboard User Guide

JD Edwards EnterpriseOne Tools. 1 Understanding JD Edwards EnterpriseOne Business Intelligence Integration. 1.1 Oracle Business Intelligence

The syslog-ng Premium Edition 5F2

Platform as a Service and Container Clouds

Monitoring Linux and Windows Logs with Graylog Collector. Bernd Ahlers Graylog, Inc.

Witango Application Server 6. Installation Guide for OS X

Blackboard Open Source Monitoring

Net/FSE Installation Guide v1.0.1, 1/21/2008

avast! for linux technical documentation

Sentinel Migration Utility

Interlink Networks Secure.XS and Cisco Wireless Deployment Guide

Chronon: A modern alternative to Log Files

UForge 3.4 Release Notes

A New Approach to Network Visibility at UBC. Presented by the Network Management Centre and Wireless Infrastructure Teams

SAIP 2012 Performance Engineering

A Comparative Analysis of Open-Source Log Management Solutions for Security Monitoring and Network Forensics. Risto Vaarandi Paweł Niziński

VERSION 9.02 INSTALLATION GUIDE.

Practice Fusion API Client Installation Guide for Windows

CommandCenter Secure Gateway

Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001

Setting Up SSL on IIS6 for MEGA Advisor

ilaw Installation Procedure

IBM Security QRadar SIEM Version MR1. Log Sources User Guide

Deploying EMC Documentum WDK Applications with IBM WebSEAL as a Reverse Proxy

E6893 Big Data Analytics: Demo Session for HW I. Ruichi Yu, Shuguan Yang, Jen-Chieh Huang Meng-Yi Hsu, Weizhen Wang, Lin Haung.

There are numerous ways to access monitors:

For Splunk Universal Forwarder and Splunk Cloud

SSL Tunnels. Introduction

Healthstone Monitoring System

The syslog-ng Premium Edition 5LTS

Analyzing large flow data sets using. visualization tools. modern open-source data search and. FloCon Max Putas

Log management with Graylog2 Lennart Koopmann, FrOSCon Mittwoch, 29. August 12

Administrator s Guide: perfsonar MDM 3.0

IUCLID 5 Guidance and Support

<Insert Picture Here> Oracle Web Cache 11g Overview

McAfee One Time Password

Partek Flow Installation Guide

VMware vcenter Log Insight Getting Started Guide

LICENSE4J AUTO LICENSE GENERATION AND ACTIVATION SERVER USER GUIDE

IBM Security QRadar Vulnerability Manager Version User Guide

<Insert Picture Here> Introducing Hudson. Winston Prakash. Click to edit Master subtitle style

D5.4.4 Integrated SemaGrow Stack API components

Web Analytics Understand your web visitors without web logs or page tags and keep all your data inside your firewall.

Authoring for System Center 2012 Operations Manager

FileMaker Server 13. FileMaker Server Help

NetIQ Sentinel Quick Start Guide

Witango Application Server 6. Installation Guide for Windows

TZWorks Windows Event Log Viewer (evtx_view) Users Guide

DETECTING ADVANCED THREATS WITH SYSMON, WEF AND ELASTICSEARCH

FileMaker Server 14. FileMaker Server Help

VMware vcenter Log Insight Getting Started Guide

FileMaker Server 9. Custom Web Publishing with PHP

PUBLIC Installation: SAP Mobile Platform Server for Linux

Serving Media with NGINX Plus

VMware vcenter Log Insight Developer's Guide

Merkle Hash Trees for Distributed Audit Logs

How To Install An Org Vm Server On A Virtual Box On An Ubuntu (Orchestra) On A Windows Box On A Microsoft Zephyrus (Orroster) 2.5 (Orner)

Using elasticsearch, logstash and kibana to create realtime dashboards

Wavelink Avalanche Mobility Center Linux Reference Guide

Configuring Multiple ACE Management Servers VMware ACE 2.0

Signiant Agent installation

Transcription:

Using NXLog with Elasticsearch and Kibana i Using NXLog with Elasticsearch and Kibana

Using NXLog with Elasticsearch and Kibana ii Contents 1 Setting up Elasticsearch and Kibana 1 1.1 Installing Elasticsearch................................................ 1 1.2 Installing Kibana................................................... 1 2 Loading data into Elasticsearch with NXLog 2 2.1 Loading data with om_elasticsearch......................................... 2 2.2 Loading data with om_http.............................................. 4 2.3 Using Logstash.................................................... 5

Using NXLog with Elasticsearch and Kibana 1 / 6 Elasticsearch coupled with the Kibana frontend has become quite popular recently as a low-cost centralized log monitoring solution. This is commonly referred to as the ELK stack comprised of Elasticsearch, Logstash and Kibana. While Logstash is a great piece of software it has some disadvantages compared to NXLog: Logstash is written in ruby and requires Java to run. Besides being a lot more hungry on system resources, many system administrators would rather not take the hassle of deploying the Java runtime onto their production servers and needing take care of the Java security updates. The Eventlog plugin in Logstash pulls the eventlog data through the Windows WMI interface which incurs a significant performance penalty. NXLog hooks directly into the Windows EventLog API natively and can collect logs from our highly loaded Domain Controllers also. It s just one more piece of software to take care about. NXLog is a small and efficient log collector that can be set up to securely and reliably centralize event data from Windows and Unix platforms. As such, NXLog is recommended by many ELK users as the log collector of choice for Windows and Linux. While most users run Logstash in front of Elasticsearch, contrary to popular belief Logstash is not necessarily needed to load data since NXLog can do this as well. This is the KEN stack: Kibana, Elasticsearch and NXLog. In this this guide we will show you how to set up and configure NXLog, Elasticsearch and the Kibana web interface. We are going use Debian Wheezy as the base OS. 1 Setting up Elasticsearch and Kibana This guide is not intended to provide all the details and it just shows the bare minimum required to get Elasticsearch and Kibana installed and running so that we can point NXLog at it. There are many guides apart from the official installation instructions on the web on how to set up and configure Elasticsearch and Kibana, for example the following two tutorials at DigitalOcean can be quite useful: How To Install Elasticsearch, Logstash, and Kibana 4 on Ubuntu 14.04 How To Use Kibana Dashboards and Visualizations 1.1 Installing Elasticsearch You can download the latest version from http://elastic.co wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.1.deb dpkg -i elasticsearch-1.5.1.deb Then start Elasticsearch with: /etc/init.d/elasticsearch start 1.2 Installing Kibana Kibana is a javascript-based web frontend for Elasticsearch offering an attractive user interface. Download and extract the latest version of Kibana: wget http://download.elastic.co/kibana/kibana/kibana-4.0.2-linux-x64.tar.gz tar xvf kibana-*.tar.gz mv kibana-4.0.2-linux-x64 /opt/kibana Now start Kibana: /opt/kibana/bin/kibana With everything in place we should be able to access Kibana from the browser at http://localhost:5601.

Using NXLog with Elasticsearch and Kibana 2 / 6 2 Loading data into Elasticsearch with NXLog 2.1 Loading data with om_elasticsearch The NXLog Enterprise Edition comes with a module that can load data natively into Elasticsearch. The advantage of this module over om_http is the support for bulk data operations and dynamic indexing. Event data is sent in batches, this greately reduces the latency caused by the HTTP responses and the elasticsearch server can also process bulk data faster. The om_elasticsearch module can insert data at a rate of 10,000EPS or more on low end hardware. For Kibana s time filters to work properly we will need to apply a template. This can be pushed to Elasticsearch with the following command: curl -XPUT localhost:9200/_template/nxlog -d { "template" : "nxlog*", "mappings" : { " _default_" : { "properties": { "EventTime": { "type": "date", "format": "YYYY-MM-dd HH: mm:ss" This will tell Elasticsearch to treat our EventTime field as date and parse it in the given format. This will be applied to all records in indexes beginning with nxlog. Further mappings can be added in the properties section. The following configuration shows how to use the om_elasticsearch module to load the log data into Elasticsearch. <Extension _json> Module xm_json </Extension> <Input in> Module im_tcp Host 0.0.0.0 Port 1514 InputType Binary <Output es> Module om_elasticsearch URL http://localhost:9200/_bulk FlushInterval 2 FlushLimit 100 # Create an index daily Index strftime($eventtime, "nxlog-%y%m%d") IndexType "My logs" # Use the following if you don t have $EventTime set #Index strftime(now(),"nxlog-%y%m%d") </Output> <Route r> Path in => es </Route> The IndexType parameter, although not mandatory, can be help sorting our logs on the dashboard. It expects a string type expression and is reevaluated for each event record. Refer to the NXLog Enterprise Edition Reference Manual for further details. The input section in the configuration above uses im_tcp with NXLog s Binary data format as this can preserve structured data across the network better than JSON. The client (agent) side configuration is not the scope of this document. After saving the configuration we should restart NXLog to apply the changes: /etc/init.d/nxlog restart Logs should now be sent to and indexed by Elasticsearch. To verify that the data is getting ingested, first we will need to configure the Kibana indexing as shown in the screenshot below.

Using NXLog with Elasticsearch and Kibana 3 / 6 Figure 1: Kibana index configuration Now we should be able to search and analyze event data on the Kibana interface.

Using NXLog with Elasticsearch and Kibana 4 / 6 Figure 2: Kibana search results 2.2 Loading data with om_http Data can be also submitted to Elasticsearch via its HTTP REST API using the om_http module available in both NXLog editions. This will send one event per HTTP request to ES in JSON format. The throughput is limited by the HTTP requestresponse latency, regardless, this may be still suitable for low-volume environments. The nxlog configuration below is for a Windows client that collects log data from a file and the Windows EventLog and sends it to the Elasticsearch server directly. define ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modules CacheDir %ROOT%\data Pidfile %ROOT%\data\nxlog.pid SpoolDir %ROOT%\data LogFile %ROOT%\data\nxlog.log <Extension json> Module xm_json </Extension> <Input internal> Module im_internal

Using NXLog with Elasticsearch and Kibana 5 / 6 <Input myapp> Module im_file File "C:\\MyApp\\Logs\\mylog.json" Exec parse_json(); Exec $EventTime = parsedate($timestamp); <Input eventlog> Module im_msvistalog <Output elasticsearch> Module om_http URL http://elasticsearch:9200 ContentType application/json Exec set_http_request_path(strftime($eventtime, "/nxlog-%y%m%d/" + $SourceModuleName)); rename_field("timestamp","@timestamp"); to_json(); </Output> <Route es> Path internal, eventlog, myapp => elasticsearch </Route> 2.3 Using Logstash Logstash is a great piece of software and may offer some additional features that can be worth the extra hassle of installing it. On the other hand most users have Logstash running in their stack simply because they don t know that it s not mandatory. Below is a client side NXLog configuration to collect file and Windows Eventlog data. The data is sent to Logstash over a TCP connection in JSON format. define ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modules CacheDir %ROOT%\data Pidfile %ROOT%\data\nxlog.pid SpoolDir %ROOT%\data LogFile %ROOT%\data\nxlog.log <Extension json> Module xm_json </Extension> <Input internal> Module im_internal <Input file> Module im_file File "C:\\MyApp\\Logs\\mylog.json" <Input eventlog> Module im_msvistalog # Uncomment if you want only specific logs # Query <QueryList>\ # <Query Id="0">\ # <Select Path="Application">*</Select>\ # <Select Path="System">*</Select>\ # <Select Path="Security">*</Select>\

Using NXLog with Elasticsearch and Kibana 6 / 6 # </Query>\ # </QueryList> <Output logstash> Module om_tcp Host 10.1.1.1 Port 3515 to_json(); </Output> <Route 66> Path </Route> file, eventlog, internal => logstash The following configuration is for the server-side Logstash process accepting event data from the NXLog clients. input { tcp { codec => json_lines { charset => CP1252 port => "3515" tags => [ "tcpjson" ] filter { date { locale => "en" timezone => "Etc/GMT" match => [ "EventTime", "YYYY-MM-dd HH:mm:ss" ] output { elasticsearch { host => localhost stdout { codec => rubydebug Note The json codec in Logstash sometimes fails to properly parse JSON and it will concatenate more than one JSON record into one event. Make sure to use the json_lines codec. Note Although the im_msvistalog module converts data to UTF-8, Logstash seems to have issues parsing that data. Apparently the charset => CP1252 can help in such situations. In this tutorial we have tried to show how to set up the ELK (or KEN) stack and send data to it. The tools are very flexible, both Logstash and NXLog come with a lot of extras such as message rewrite, parsing and field extraction, log rotation, correlation, TLS support and much more. While the configurations shown here mostly focused on using NXLog on Windows as a client side collector, NXLog can be also configured to collect file, syslog and kernel logs on Linux systems and forward that to Logstash, to an NXLog server or directly to Elasticseach the same way. Feel free to drop us a line if you have any questions and comments or are interested in the enterprise offering and support.