Elasticsearch and The Elk Stack For Monitoring and Data Analysis
Elasticsearch and The Elk Stack For Monitoring and Data Analysis
Elasticsearch and The Elk Stack For Monitoring and Data Analysis
data analysis
Clemens Düpmeier (KIT / IAI)
Use Cases
Summary
2 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Elasticsearch ELK Software Stack
Logstash
Log Kibana
3 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Logstash
4 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Configuration
Multiple inputs of
different types
Conditionally
filter and
transform data;
some common
formats are
already known
Forward to
multiple outputs
5 09/09/2015 Institute for Applied Computer Science (IAI)
Console output processing apache log files
Run logstash with: bin/logstash -f logstash.conf
6 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Configuration for parsing syslog messages
8 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Input Plugins
9 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Lumberjack plugin + Logstash forwarder
11 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Multiple node writes
12 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Filter plugins
grok -> parse and structure arbitrary text: best generic option to
interpret text as (semi-)structured objects
13 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
grok usage example
filter {
grok { match => { "message" => "%{IP:client} %
{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes}
%{NUMBER:duration}" }
}
14 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Scaling and high availability
16 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Scalability of Elasticsearch
17 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Indexing data with Elasticsearch
18 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Indexing data using the REST API
PUT request inserts the JSON payload into the index with name “megacorp” as
object of type “employee”
Schema for type can be explicitly defined (at time of index creation or
automatically determined)
Text field (e.g. “about”) will be analyzed if analyzers are configured for that field
Request URL specifies the identifier “1” for the index entry
19 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Retrieval of a index entry
GET /megacorp/employee/1
20 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Simple Query
GET /megacorp/employee/_search
23 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
More complex queries with Query DSL
Consist of a query
and a filter part
Query part
matches all entries
with last_name
“smith” (2)
Filter will then only
select entries
which fulfill the
range filter (1)
“age”: {“gt” : 30 }
24 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Some query possibilities
25 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
More advanced features
Multi-tenant
Spatial data queries
Search suggestions
Real time aggregation of search data
Statistical calculations (sums, mean value, max, min, …)
Faceting
By using terms
Statistical calculations
Classification ( Grouping by using ranges
Filter rules
By geographical distance
…
26 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Kibana
Web-based application for exploring and visualizing data
Modern Browser-based interface (HTML5 + JavaScript)
Ships with its own web server for easy setup
Seamless integration with Elasticsearch
27 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Configure Kibana
After installation first configure Kibana to access
Elasticsearch server(s)
Should be done by editing the Kibana config file
Then use web UI to configure indexes to use
28 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Discover data
29 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Create a visualization
30 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Different types of visualizations
31 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Combine visualizations to a Dashboard
32 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
USE CASES
33 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Some use cases of the ELK stack
Use the ELK stack for search driven access to mass data
in web based information systems
34 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Log data management and analysis
35 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Problems of log data analysis
No centralization
Log data could be everywhere
on different servers and different places within the same server
Accessibility Problems
Logs can be difficult to find
Access to server / device is often difficult for analyst
High expertise for accessing logs on different platforms necessary
Logs can be big and therefore difficult to copy
SSH access and grep on logs doesn’t scale or reach
No Consistency
Structure of log entries is different for each app, system, or device
Specific knowledge is necessary for interpreting different log types
Variation in formats makes it challenging to search
Many different types of time formats
36 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
The ELK stack provides solutions
Logstash allows to collect all log entries at a central place (e.g. Elasticsearch)
End users don’t need to know where the log files are located
Big log files will be transferred continuously in smaller chunks
37 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Monitoring
38 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Log analysis examples from the Internet
The ELK stack is easy to use and has many use cases
Log data management and analysis
Monitor systems and / or applications and notify operators about
critical events
Collect and analyze other (mass) data
Providing access to big data in large scale web applications
40 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
BACKUP SLIDES
41 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Search based web applications
Use search engine technology
as key element for data access
(e.g. ElasticSearch)
42 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
The openTA portal: www.openta.net
43 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Search driven architecture (example openTA)
User
Web UI
Portal
Organization
APIs
45 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)
Prototype: Search with „Energie –Rohracher“
46 09/09/2015 Research group “ Web based Information Systems“ Institute for Applied Computer Science (IAI)