SlideShare a Scribd company logo
1 of 30
Download to read offline
Log Analysis with the ELK
Stack (Elasticsearch,
Logstash and Kibana)
Gary Smith, Pacific Northwest National Laboratory
A Little Context
! The Five Golden Principles of Security
! Know your system
! Principle of Least Privilege
! Defense in Depth
! Protection is key but detection is a must.
! Know your enemy.
2
In the Days of Chinook
! For most of Chinook's lifetime, the MSC used the "free"
version of Splunk to review the syslogs.
! Splunk Inc. has an interesting licensing model that's sort
of like an all-you-can-eat buffet where you pay by the
pound:
! The more you ingest, the more you pay.
! If you ingest < 500MB of logs a day, Splunk is "free".
! If you go over that limit too many times, Splunk will
continue to index your logs but you can't view them until
you pay them $$$ or you reinstall Splunk.
! Consequently, I was always fiddling with Syslog-NG's
rules to keep the cruft out and keep the daily log data <
500MB.
3
The Dawning of Cascade
! When the talk about what would later be known as
Cascade started ramping up, I started looking at a
replacement for Splunk because I knew that I would not
be able to keep under the 500MB limit with two
supercomputers in operation.
! The price for a commercial license for Splunk for the
amount of log data the MSC's systems produced would
be prohibitive.
4
Alternatives to Splunk
! I looked at a lot of alternatives to Splunk. These are just
some of them:
! Graylog2
! Nxlog
! Octopussy
! Logscape,
! ELSA
! LOGanalyzer
! Logalyzer
! Logwatcher
! logHound
! logReport
! Logsurfer
! PHP-Syslog-NG
5
Alternative to Splunk
! Some wouldn't build. Some wouldn’t work.
! Some were slow.
! Some had an abysmal user interface.
! Most all of them had a MySQL, PostgreSQL, or similar
relational database backend for storage and retrieval.
6
The Solution: ELK Stack [Elasticsearch,
Logstash, Kibana]
! Elasticsearch: Indexing, storage and retrieval engine
! Logstash: Log input slicer and dicer and output writer
! Kibana: Data displayer
7
Early Experiments With The Stack
! In the early stages of the ELK stack, the pieces didn't play
well together.
! Early versions of Logstash needed specific versions of
Elasticsearch and those weren't the latest ones.
! This caused some problems because Kibana wanted the
latest version of Elasticsearch.
! So I tried a couple of alternatives to ELK.
8
EFK
! EFK => Elasticsearch FluentD Kibana
! This worked pretty well.
! Good points:
! With FluentD, you install it, point it at Elasticsearch, point your
syslogs at Fluentd and you're good to go.
! Bad Points:
! There's not much you can do to extend FluentD to do things with
the syslog events coming in.
9
ERK
! ERK => Elasticsearch Rsyslogd Kibana
! There's an Rsyslogd plugin that takes syslog events and
sends them to Elasticsearch.
! Good points:
! Much like FluentD, you install it, point it at Elasticsearch and point
your syslogs at Rsyslogd and you're good to go.
! Bad Points:
! The plugin requires the very latest version of Rsyslogd, so you
have to build the latest version of Rsyslogd and the plugin.
! Then, you have to maintain the version of Rsyslogd and the plugin
since it's two major revisions above what's available in RHEL.
10
Finally, One Big Happy Family
! The dysfunctional aspects of the ELK stack got worked
out.
! Now the members of the ELK stack play well together
after being unified with help from the Elasticsearch
people.
11
Components of The ELK Stack
[Elasticsearch Logstash Kibana]
12
Logstash
! Logstash was developed by Jordan Sissel when he was a
system administrator at Dreamhost.
! Jordan needed something that could handle a peak of
20,000 messages per second.
! Logstash is easy to set up, scalable, and easy to extend.
13
Logstash Hosts
! In most cases there are two broad classes of Logstash
hosts:
! Hosts running the Logstash agent as an event forwarder that
sends you application, service, and host logs to a central
Logstash server.
! Central Logstash hosts running some combination of archiver,
indexer, search, storage, and web interface software which
receive, process, and store your logs.
14
Logstash Basic Configuration File
! A basic configuration file for Logstash has 3 sections:
! input
! filter
! output
15
The Input Section
16
! Inputs are the mechanism for passing log data to
Logstash. Some of the more useful, commonly-used ones
are:
! file: reads from a file on the filesystem, much like the UNIX
command "tail -f"
! syslog: listens on the well-known port 514 for syslog messages
and parses according to RFC3164 format
! lumberjack: processes events sent in the lumberjack protocol.
Now called logstash-forwarder.
The Filter Section
! Filters are workhorses for processing inputs in the Logstash
chain.
! They are often combined with conditionals in order to perform a
certain action on an event, if it matches particular criteria.
! Some useful filters:
! grok: parses arbitrary text and structures it.
! Grok is currently the best way in Logstash to parse unstructured
log data into something structured and queryable.
! With 120 patterns shipped built-in to Logstash, it’s more than
likely you’ll find one that meets your needs!
! mutate: The mutate filter allows you to do general mutations to fields.
You can rename, remove, replace, and modify fields in your events.
! drop: Drop an event completely, for example, debug events.
! geoip: Adds information about geographical location of IP addresses
(and displays amazing charts in Kibana)
17
The Output Section
18
! Outputs are the final phase of the Logstash pipeline.
! An event may pass through multiple outputs during
processing, but once all outputs are complete, the event
has finished its execution.
! Some commonly used outputs include:
! elasticsearch: If you’re planning to save your data in an efficient,
convenient and easily queryable format… Elasticsearch is the
way to go. Period. Yes, we’re biased :)
! file: writes event data to a file on disk.
! statsd: a service which "listens for statistics, like counters and
timers, sent over UDP and sends aggregates to one or more
pluggable backend services".
! If you’re already using statsd, this could be useful for you!
Elasticsearch: Hard made Easy
! Elasticsearch is a powerful indexing and search tool.
! The Elasticsearch team says, "Elasticsearch is a
response to the claim, 'Search is hard'".
! Elasticsearch is easy to set up, has search and index data
available RESTfully as JSON over HTTP and is easy to
scale and extend.
! It's released under the Apache 2.0 license and is built on
top of Apache's Lucene project.
19
Elasticsearch: How it works!
! Elasticsearch is a text indexing search engine.
! The best metaphor to describe Elasticsearch is the index
of a book.
! You flip to the back of a book, look up a word and then
find the reference page.
! This means that rather than searching text strings directly,
Elasticsearch creates an index from incoming text and
performs searches on the index rather than the content.
! As a result, it is very fast.
20
Elasticsearch Configuration
! Elasticsearch is started with a default cluster name of
"elasticsearch" and a random node name based on
characters from the X-Men.
! A new random node name is selected each time
Elasticsearch is restarted if one has not been chosen.
! If you want to customize your cluster and node names to
ensure unique names, edit /etc/elasticsearch/
elasticsearch.yml. !
! This is Elasticsearch's YAML-based configuration file.
21
The Kibana Web Interface
! The Kibana web interface is a customizable dashboard that
you can extend and modify to suit your environment.
! It allows the querying of events, creation of tables and graphs
as well as sophisticated visualizations.
! The Kibana web interface uses the Apache Lucene query
syntax to allow you to make queries.
! You can search any of the fields contained in a Logstash event,
for example, message, syslog_program, etc.
! You can use Boolean logic with AND, OR, NOT as well as
fuzzy searches and wildcard searches.
! You can:
! Build complex queries (including saving them and displaying the
results as a new panel)
! Graph and visualize data
! Produce tables and display data on maps and charts.
22
Troubleshooting: Is It Running?
! How do you tell if Elasticsearch is running? !
! Do this: curl http://10.0.0.1:9200/_status?pretty=true!
! This will return a page that contains a variety of
information about the state and status of your
Elasticsearch server.!
23
Troubleshooting: Are Logstash And
Elasticsearch Working Together?
! How can you check to see if Logstash is getting events to
Elasticsearch and they are getting indexed?
! Do this:
curl "http://localhost:9200/_search q=type:syslog&pretty=true" !
24
Troubleshooting: Syntax Checking Your
Logstash Configuration File
! After you've written/modified your Logstash configuration
file, how do you know it's syntactically correct before you
put it into production
! Do this:
/opt/logstash/bin/logstash agent -f logstash.conf --configtest !
25
Getting Rid Of Old Data
! One of the things I could never figure out with Splunk is
"How do I get expire old data out of Splunk?"
! What about Elasticsearch? Can I expire old data out of
Elasticsearch and keep only what's recent and relevant?
! As it turns out, like most things in the Linux-Sphere,
there's more than one way to do it.
! I have a daily cron job that runs a Perl script that deletes
data out of Elasticsearch older that 31 days.
! There is also a python program called Curator by Aaron
Mildenstein that helps you curate, or manage your
Elasticsearch indices like a museum curator manages the
exhibits and collections on display.
26
Debugging Grok Patterns
! Remember those patterns I was using in the grok filter to
parse out the fields in a syslog event? How did I come up
with those?
! I used the Grok Debugger at http://grokdebug.herokuapp.com/
to work out the construction of the pattern.
! The Grok Debugger is an interactive web page that
facilitates rapid creation of patterns based on sample
input.
27
The Grok Debugger In Action
28
References
! http://www.elastic.co/
! http://logstash.net/docs/latest
! https://www.elastic.co/products/kibana
! https://github.com/elastic/curator/wiki
! http://www.fluentd.org/
! http://www.rsyslog.com/
! http://grokdebug.herokuapp.com/
29
Questions?
30
Gary Smith
Information System Security Officer, Molecular Science
Computing, Pacific Northwest National Laboratory
Richland, WA
gary.smith@pnnl.gov

More Related Content

What's hot

ElasticSearch Basic Introduction
ElasticSearch Basic IntroductionElasticSearch Basic Introduction
ElasticSearch Basic IntroductionMayur Rathod
 
ELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log ManagementELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log ManagementEl Mahdi Benzekri
 
Centralized log-management-with-elastic-stack
Centralized log-management-with-elastic-stackCentralized log-management-with-elastic-stack
Centralized log-management-with-elastic-stackRich Lee
 
Log analysis using elk
Log analysis using elkLog analysis using elk
Log analysis using elkRushika Shah
 
Elastic stack Presentation
Elastic stack PresentationElastic stack Presentation
Elastic stack PresentationAmr Alaa Yassen
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and KibanaLog analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and KibanaAvinash Ramineni
 
Introduction to elasticsearch
Introduction to elasticsearchIntroduction to elasticsearch
Introduction to elasticsearchhypto
 
Introduction To Kibana
Introduction To KibanaIntroduction To Kibana
Introduction To KibanaJen Stirrup
 
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...Edureka!
 
Logstash-Elasticsearch-Kibana
Logstash-Elasticsearch-KibanaLogstash-Elasticsearch-Kibana
Logstash-Elasticsearch-Kibanadknx01
 
Keeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and Logstash
Keeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and LogstashKeeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and Logstash
Keeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and LogstashAmazon Web Services
 
Elastic search overview
Elastic search overviewElastic search overview
Elastic search overviewABC Talks
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...ForgeRock
 
Elasticsearch for beginners
Elasticsearch for beginnersElasticsearch for beginners
Elasticsearch for beginnersNeil Baker
 
Introduction to ELK
Introduction to ELKIntroduction to ELK
Introduction to ELKYuHsuan Chen
 

What's hot (20)

ElasticSearch Basic Introduction
ElasticSearch Basic IntroductionElasticSearch Basic Introduction
ElasticSearch Basic Introduction
 
ELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log ManagementELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log Management
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
Centralized log-management-with-elastic-stack
Centralized log-management-with-elastic-stackCentralized log-management-with-elastic-stack
Centralized log-management-with-elastic-stack
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
Log analysis using elk
Log analysis using elkLog analysis using elk
Log analysis using elk
 
Elastic stack Presentation
Elastic stack PresentationElastic stack Presentation
Elastic stack Presentation
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and KibanaLog analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana
 
Elk - An introduction
Elk - An introductionElk - An introduction
Elk - An introduction
 
Introduction to elasticsearch
Introduction to elasticsearchIntroduction to elasticsearch
Introduction to elasticsearch
 
Introduction To Kibana
Introduction To KibanaIntroduction To Kibana
Introduction To Kibana
 
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
Elasticsearch Tutorial | Getting Started with Elasticsearch | ELK Stack Train...
 
Logstash-Elasticsearch-Kibana
Logstash-Elasticsearch-KibanaLogstash-Elasticsearch-Kibana
Logstash-Elasticsearch-Kibana
 
Keeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and Logstash
Keeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and LogstashKeeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and Logstash
Keeping Up with the ELK Stack: Elasticsearch, Kibana, Beats, and Logstash
 
ELK introduction
ELK introductionELK introduction
ELK introduction
 
Elastic search overview
Elastic search overviewElastic search overview
Elastic search overview
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
 
Elasticsearch for beginners
Elasticsearch for beginnersElasticsearch for beginners
Elasticsearch for beginners
 
Introduction to ELK
Introduction to ELKIntroduction to ELK
Introduction to ELK
 

Viewers also liked

ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)Mathew Beane
 
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.Airat Khisamov
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Andrii Vozniuk
 
Architecting your Splunk deployment
Architecting your Splunk deploymentArchitecting your Splunk deployment
Architecting your Splunk deploymentSplunk
 
Scalable Cloud Solutions with Node.js
Scalable Cloud Solutions with Node.jsScalable Cloud Solutions with Node.js
Scalable Cloud Solutions with Node.jsmpneuried
 
Open source log analytics
Open source log analyticsOpen source log analytics
Open source log analyticsVinod Nayal
 
"How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics."How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics.Vladimir Pavkin
 
ELK: a log management framework
ELK: a log management frameworkELK: a log management framework
ELK: a log management frameworkGiovanni Bechis
 
Elk with Openstack
Elk with OpenstackElk with Openstack
Elk with OpenstackArun prasath
 
Elk meetup boston - logz.io
Elk meetup boston -  logz.ioElk meetup boston -  logz.io
Elk meetup boston - logz.iotomerlevy9
 
Persistence in the cloud with bosh
Persistence in the cloud with boshPersistence in the cloud with bosh
Persistence in the cloud with boshm_richardson
 
Developing functional safety systems with arm architecture solutions stroud
Developing functional safety systems with arm architecture solutions   stroudDeveloping functional safety systems with arm architecture solutions   stroud
Developing functional safety systems with arm architecture solutions stroudArm
 
Monitoring Docker with ELK
Monitoring Docker with ELKMonitoring Docker with ELK
Monitoring Docker with ELKDaniel Berman
 
Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)
Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)
Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)Cohesive Networks
 
Software development in ar mv8 m architecture - yiu
Software development in ar mv8 m architecture - yiuSoftware development in ar mv8 m architecture - yiu
Software development in ar mv8 m architecture - yiuArm
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformSZ Lin
 
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linaro
 

Viewers also liked (20)

ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)
 
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
 
Architecting your Splunk deployment
Architecting your Splunk deploymentArchitecting your Splunk deployment
Architecting your Splunk deployment
 
Scalable Cloud Solutions with Node.js
Scalable Cloud Solutions with Node.jsScalable Cloud Solutions with Node.js
Scalable Cloud Solutions with Node.js
 
Open source log analytics
Open source log analyticsOpen source log analytics
Open source log analytics
 
"How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics."How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics.
 
ELK: a log management framework
ELK: a log management frameworkELK: a log management framework
ELK: a log management framework
 
Elk with Openstack
Elk with OpenstackElk with Openstack
Elk with Openstack
 
Elk meetup boston - logz.io
Elk meetup boston -  logz.ioElk meetup boston -  logz.io
Elk meetup boston - logz.io
 
History of c++
History of c++History of c++
History of c++
 
Persistence in the cloud with bosh
Persistence in the cloud with boshPersistence in the cloud with bosh
Persistence in the cloud with bosh
 
Developing functional safety systems with arm architecture solutions stroud
Developing functional safety systems with arm architecture solutions   stroudDeveloping functional safety systems with arm architecture solutions   stroud
Developing functional safety systems with arm architecture solutions stroud
 
Monitoring Docker with ELK
Monitoring Docker with ELKMonitoring Docker with ELK
Monitoring Docker with ELK
 
Kgdb kdb modesetting
Kgdb kdb modesettingKgdb kdb modesetting
Kgdb kdb modesetting
 
Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)
Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)
Lessons Learned in Deploying the ELK Stack (Elasticsearch, Logstash, and Kibana)
 
Software development in ar mv8 m architecture - yiu
Software development in ar mv8 m architecture - yiuSoftware development in ar mv8 m architecture - yiu
Software development in ar mv8 m architecture - yiu
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 Platform
 
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
 
Think Async in Java 8
Think Async in Java 8Think Async in Java 8
Think Async in Java 8
 

Similar to Log analysis with the elk stack

elkstack-161217091231.pdf
elkstack-161217091231.pdfelkstack-161217091231.pdf
elkstack-161217091231.pdfAgusNursidik
 
2015 03-16-elk at-bsides
2015 03-16-elk at-bsides2015 03-16-elk at-bsides
2015 03-16-elk at-bsidesJeremy Cohoe
 
Elk presentation 2#3
Elk presentation 2#3Elk presentation 2#3
Elk presentation 2#3uzzal basak
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.comRenzo Tomà
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
Filebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptxFilebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptxKnoldus Inc.
 
Elasticsearch features and ecosystem
Elasticsearch features and ecosystemElasticsearch features and ecosystem
Elasticsearch features and ecosystemPavel Alexeev
 
Managing your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed LuxembourgManaging your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed LuxembourgDavid Pilato
 
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
Metrics, Logs, Transaction Traces, Anomaly Detection at ScaleMetrics, Logs, Transaction Traces, Anomaly Detection at Scale
Metrics, Logs, Transaction Traces, Anomaly Detection at ScaleSematext Group, Inc.
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Prajal Kulkarni
 
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudRick Bilodeau
 
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco IntercloudStreamsets Inc.
 
Elk presentation1#3
Elk presentation1#3Elk presentation1#3
Elk presentation1#3uzzal basak
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and ElasticsearchDean Hamstead
 
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
 ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in... ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...Saurabh Nanda
 
Centralized Logging System Using ELK Stack
Centralized Logging System Using ELK StackCentralized Logging System Using ELK Stack
Centralized Logging System Using ELK StackRohit Sharma
 
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAmazon Web Services
 

Similar to Log analysis with the elk stack (20)

elkstack-161217091231.pdf
elkstack-161217091231.pdfelkstack-161217091231.pdf
elkstack-161217091231.pdf
 
2015 03-16-elk at-bsides
2015 03-16-elk at-bsides2015 03-16-elk at-bsides
2015 03-16-elk at-bsides
 
elk_stack_alexander_szalonnas
elk_stack_alexander_szalonnaselk_stack_alexander_szalonnas
elk_stack_alexander_szalonnas
 
Elk presentation 2#3
Elk presentation 2#3Elk presentation 2#3
Elk presentation 2#3
 
Mulesoft ELK
Mulesoft ELKMulesoft ELK
Mulesoft ELK
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.com
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
Elk stack @inbot
Elk stack @inbotElk stack @inbot
Elk stack @inbot
 
Filebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptxFilebeat Elastic Search Presentation.pptx
Filebeat Elastic Search Presentation.pptx
 
Elasticsearch features and ecosystem
Elasticsearch features and ecosystemElasticsearch features and ecosystem
Elasticsearch features and ecosystem
 
Managing your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed LuxembourgManaging your black friday logs Voxxed Luxembourg
Managing your black friday logs Voxxed Luxembourg
 
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
Metrics, Logs, Transaction Traces, Anomaly Detection at ScaleMetrics, Logs, Transaction Traces, Anomaly Detection at Scale
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
 
Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.Null Bachaav - May 07 Attack Monitoring workshop.
Null Bachaav - May 07 Attack Monitoring workshop.
 
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
 
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
 
Elk presentation1#3
Elk presentation1#3Elk presentation1#3
Elk presentation1#3
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and Elasticsearch
 
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
 ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in... ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
ABRIDGED VERSION - Joys & frustrations of putting 34,000 lines of Haskell in...
 
Centralized Logging System Using ELK Stack
Centralized Logging System Using ELK StackCentralized Logging System Using ELK Stack
Centralized Logging System Using ELK Stack
 
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch ServiceAWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
 

Recently uploaded

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Log analysis with the elk stack

  • 1. Log Analysis with the ELK Stack (Elasticsearch, Logstash and Kibana) Gary Smith, Pacific Northwest National Laboratory
  • 2. A Little Context ! The Five Golden Principles of Security ! Know your system ! Principle of Least Privilege ! Defense in Depth ! Protection is key but detection is a must. ! Know your enemy. 2
  • 3. In the Days of Chinook ! For most of Chinook's lifetime, the MSC used the "free" version of Splunk to review the syslogs. ! Splunk Inc. has an interesting licensing model that's sort of like an all-you-can-eat buffet where you pay by the pound: ! The more you ingest, the more you pay. ! If you ingest < 500MB of logs a day, Splunk is "free". ! If you go over that limit too many times, Splunk will continue to index your logs but you can't view them until you pay them $$$ or you reinstall Splunk. ! Consequently, I was always fiddling with Syslog-NG's rules to keep the cruft out and keep the daily log data < 500MB. 3
  • 4. The Dawning of Cascade ! When the talk about what would later be known as Cascade started ramping up, I started looking at a replacement for Splunk because I knew that I would not be able to keep under the 500MB limit with two supercomputers in operation. ! The price for a commercial license for Splunk for the amount of log data the MSC's systems produced would be prohibitive. 4
  • 5. Alternatives to Splunk ! I looked at a lot of alternatives to Splunk. These are just some of them: ! Graylog2 ! Nxlog ! Octopussy ! Logscape, ! ELSA ! LOGanalyzer ! Logalyzer ! Logwatcher ! logHound ! logReport ! Logsurfer ! PHP-Syslog-NG 5
  • 6. Alternative to Splunk ! Some wouldn't build. Some wouldn’t work. ! Some were slow. ! Some had an abysmal user interface. ! Most all of them had a MySQL, PostgreSQL, or similar relational database backend for storage and retrieval. 6
  • 7. The Solution: ELK Stack [Elasticsearch, Logstash, Kibana] ! Elasticsearch: Indexing, storage and retrieval engine ! Logstash: Log input slicer and dicer and output writer ! Kibana: Data displayer 7
  • 8. Early Experiments With The Stack ! In the early stages of the ELK stack, the pieces didn't play well together. ! Early versions of Logstash needed specific versions of Elasticsearch and those weren't the latest ones. ! This caused some problems because Kibana wanted the latest version of Elasticsearch. ! So I tried a couple of alternatives to ELK. 8
  • 9. EFK ! EFK => Elasticsearch FluentD Kibana ! This worked pretty well. ! Good points: ! With FluentD, you install it, point it at Elasticsearch, point your syslogs at Fluentd and you're good to go. ! Bad Points: ! There's not much you can do to extend FluentD to do things with the syslog events coming in. 9
  • 10. ERK ! ERK => Elasticsearch Rsyslogd Kibana ! There's an Rsyslogd plugin that takes syslog events and sends them to Elasticsearch. ! Good points: ! Much like FluentD, you install it, point it at Elasticsearch and point your syslogs at Rsyslogd and you're good to go. ! Bad Points: ! The plugin requires the very latest version of Rsyslogd, so you have to build the latest version of Rsyslogd and the plugin. ! Then, you have to maintain the version of Rsyslogd and the plugin since it's two major revisions above what's available in RHEL. 10
  • 11. Finally, One Big Happy Family ! The dysfunctional aspects of the ELK stack got worked out. ! Now the members of the ELK stack play well together after being unified with help from the Elasticsearch people. 11
  • 12. Components of The ELK Stack [Elasticsearch Logstash Kibana] 12
  • 13. Logstash ! Logstash was developed by Jordan Sissel when he was a system administrator at Dreamhost. ! Jordan needed something that could handle a peak of 20,000 messages per second. ! Logstash is easy to set up, scalable, and easy to extend. 13
  • 14. Logstash Hosts ! In most cases there are two broad classes of Logstash hosts: ! Hosts running the Logstash agent as an event forwarder that sends you application, service, and host logs to a central Logstash server. ! Central Logstash hosts running some combination of archiver, indexer, search, storage, and web interface software which receive, process, and store your logs. 14
  • 15. Logstash Basic Configuration File ! A basic configuration file for Logstash has 3 sections: ! input ! filter ! output 15
  • 16. The Input Section 16 ! Inputs are the mechanism for passing log data to Logstash. Some of the more useful, commonly-used ones are: ! file: reads from a file on the filesystem, much like the UNIX command "tail -f" ! syslog: listens on the well-known port 514 for syslog messages and parses according to RFC3164 format ! lumberjack: processes events sent in the lumberjack protocol. Now called logstash-forwarder.
  • 17. The Filter Section ! Filters are workhorses for processing inputs in the Logstash chain. ! They are often combined with conditionals in order to perform a certain action on an event, if it matches particular criteria. ! Some useful filters: ! grok: parses arbitrary text and structures it. ! Grok is currently the best way in Logstash to parse unstructured log data into something structured and queryable. ! With 120 patterns shipped built-in to Logstash, it’s more than likely you’ll find one that meets your needs! ! mutate: The mutate filter allows you to do general mutations to fields. You can rename, remove, replace, and modify fields in your events. ! drop: Drop an event completely, for example, debug events. ! geoip: Adds information about geographical location of IP addresses (and displays amazing charts in Kibana) 17
  • 18. The Output Section 18 ! Outputs are the final phase of the Logstash pipeline. ! An event may pass through multiple outputs during processing, but once all outputs are complete, the event has finished its execution. ! Some commonly used outputs include: ! elasticsearch: If you’re planning to save your data in an efficient, convenient and easily queryable format… Elasticsearch is the way to go. Period. Yes, we’re biased :) ! file: writes event data to a file on disk. ! statsd: a service which "listens for statistics, like counters and timers, sent over UDP and sends aggregates to one or more pluggable backend services". ! If you’re already using statsd, this could be useful for you!
  • 19. Elasticsearch: Hard made Easy ! Elasticsearch is a powerful indexing and search tool. ! The Elasticsearch team says, "Elasticsearch is a response to the claim, 'Search is hard'". ! Elasticsearch is easy to set up, has search and index data available RESTfully as JSON over HTTP and is easy to scale and extend. ! It's released under the Apache 2.0 license and is built on top of Apache's Lucene project. 19
  • 20. Elasticsearch: How it works! ! Elasticsearch is a text indexing search engine. ! The best metaphor to describe Elasticsearch is the index of a book. ! You flip to the back of a book, look up a word and then find the reference page. ! This means that rather than searching text strings directly, Elasticsearch creates an index from incoming text and performs searches on the index rather than the content. ! As a result, it is very fast. 20
  • 21. Elasticsearch Configuration ! Elasticsearch is started with a default cluster name of "elasticsearch" and a random node name based on characters from the X-Men. ! A new random node name is selected each time Elasticsearch is restarted if one has not been chosen. ! If you want to customize your cluster and node names to ensure unique names, edit /etc/elasticsearch/ elasticsearch.yml. ! ! This is Elasticsearch's YAML-based configuration file. 21
  • 22. The Kibana Web Interface ! The Kibana web interface is a customizable dashboard that you can extend and modify to suit your environment. ! It allows the querying of events, creation of tables and graphs as well as sophisticated visualizations. ! The Kibana web interface uses the Apache Lucene query syntax to allow you to make queries. ! You can search any of the fields contained in a Logstash event, for example, message, syslog_program, etc. ! You can use Boolean logic with AND, OR, NOT as well as fuzzy searches and wildcard searches. ! You can: ! Build complex queries (including saving them and displaying the results as a new panel) ! Graph and visualize data ! Produce tables and display data on maps and charts. 22
  • 23. Troubleshooting: Is It Running? ! How do you tell if Elasticsearch is running? ! ! Do this: curl http://10.0.0.1:9200/_status?pretty=true! ! This will return a page that contains a variety of information about the state and status of your Elasticsearch server.! 23
  • 24. Troubleshooting: Are Logstash And Elasticsearch Working Together? ! How can you check to see if Logstash is getting events to Elasticsearch and they are getting indexed? ! Do this: curl "http://localhost:9200/_search q=type:syslog&pretty=true" ! 24
  • 25. Troubleshooting: Syntax Checking Your Logstash Configuration File ! After you've written/modified your Logstash configuration file, how do you know it's syntactically correct before you put it into production ! Do this: /opt/logstash/bin/logstash agent -f logstash.conf --configtest ! 25
  • 26. Getting Rid Of Old Data ! One of the things I could never figure out with Splunk is "How do I get expire old data out of Splunk?" ! What about Elasticsearch? Can I expire old data out of Elasticsearch and keep only what's recent and relevant? ! As it turns out, like most things in the Linux-Sphere, there's more than one way to do it. ! I have a daily cron job that runs a Perl script that deletes data out of Elasticsearch older that 31 days. ! There is also a python program called Curator by Aaron Mildenstein that helps you curate, or manage your Elasticsearch indices like a museum curator manages the exhibits and collections on display. 26
  • 27. Debugging Grok Patterns ! Remember those patterns I was using in the grok filter to parse out the fields in a syslog event? How did I come up with those? ! I used the Grok Debugger at http://grokdebug.herokuapp.com/ to work out the construction of the pattern. ! The Grok Debugger is an interactive web page that facilitates rapid creation of patterns based on sample input. 27
  • 28. The Grok Debugger In Action 28
  • 29. References ! http://www.elastic.co/ ! http://logstash.net/docs/latest ! https://www.elastic.co/products/kibana ! https://github.com/elastic/curator/wiki ! http://www.fluentd.org/ ! http://www.rsyslog.com/ ! http://grokdebug.herokuapp.com/ 29
  • 30. Questions? 30 Gary Smith Information System Security Officer, Molecular Science Computing, Pacific Northwest National Laboratory Richland, WA gary.smith@pnnl.gov