SlideShare a Scribd company logo
1 of 52
Download to read offline
ELK Stack - Kibana操作實務
Elasticsearch, Logstash, Kibana一起講不完
從看得見的操作面開始
總管理處資訊管理部 張凱迪
kedy.ch@udngroup.com
1
Outline
• Basic Concept
• Discover
• Visualization
• Dashboard
• Conclusion
2
Kibana
• 有點像Splunk的東西
• 嚴格說起來不能比
• 認真說來也買不起
3
欄位名稱
搜尋條件
符合搜尋條件之事件數分布
符合搜尋條件之事件內容
功能表選單
基礎觀念
4https://kedy.gitbooks.io/elkstack/content/elasticsearch-01.html
5http://log.udngroup.com:9200/_plugin/kopf
基礎觀念
6
• 主要欄位
• @source_host
• @source_host_ip
• @timestamp
• @version
• 資料型態
• 文字
• 地點
• 時間
• 數字
基礎觀念
• Documents in Elasticsearch
• 可以是非結構化型態
• 不定義欄位也可以搜尋跟儲存
• 但不好分析 (無法視覺化)
• 要定義欄位
7
Discover
8
Discover
9
• 關鍵字搜尋
• 邏輯運算子
• 指定欄位
• 數值範圍
• 可組合運用
現在有什麼
• 假單(IIS5)
• type: iis5
• Oracle ERP (Apache)
• type: apache
• Paloalto (類syslog)
• type: paloalto
• 當logstash grok解析錯誤時會加上tag: _grokparsefailure
10
1973年 蔣經國於行政院長任內公開演講
• 當時工商界的困境
• 政府借錢給企業,限定用在工業商業活動
• 醬油的錢就是買醬油、買醋的錢就是買醋
11
12
賺錢要正當、用錢要恰當
• 日誌分析也是
• IIS的response就是IIS的response
• Apache的response就是apache的response
• 不能混為一談
• type要限定好
13
基礎觀念
• 先清楚什麼type存什麼log
• 框好圈圈, 找到結果才正確
• 預期要找IIS server Reponse=500
• 使用使用resposne: 500去找
• 結果會有一堆apache的response:500 (因為都是response欄位)
• 建議搜尋都要指定好type
• 同時看不同設備 再用布林運算 OR 同時呈現不同條件
14
Discover-搜尋
• SourceAddress: “10.201.80.51”
• 聯經數位假單系統測試主機
• 每分鐘觸發6000筆事件紀錄,累計約6300萬筆
15
Discover-搜尋
• SourceAddress: “10.201.80.51”
• 聯經數位假單系統測試主機
• 每天觸發50萬到100萬次不等,聞到怪怪的味道
• 接著查連去哪、做什麼(才有前面的故事可以講)
16
Discover-搜尋
• 好
亂
喔
17
Discover-搜尋
• 顯示特定欄位-欄位後方按下add
18
•常用的搜尋做完記得存檔
• 關鍵字搜尋
• 邏輯運算子
• 指定欄位
• 數值範圍
• 可組合運用
操作時間
1. ERP非200 OK回應數量比例
• Tip: 從左側欄位列看比例
2. 外部存取ERP 回應為
404 not found最多是誰
3. 假單70851取得請假紀錄次數
• Tip: GetPersonalLeave.asp
• Tip: txtUserID
4. 今年八月PA commit次數
• 要求: 只顯示日期、命令
5. 今年八月PA email密碼嘗試
• POP3, SMTP, IMAP比例
• 先觀察,用直覺累積經驗 19
• ERP系統非200 OK回應
• type: apache AND NOT tags:"_grokparsefailure" AND NOT
response:200
操作時間1
20
操作時間2
• 外部存取ERP 回應為404 not found最多是誰
• type: apache AND NOT tags:"_grokparsefailure" AND
response:404 AND NOT clientip:10.*
• RFC定義之private IP更廣, 可自行嘗試
21
操作時間3
• 假單70851取得請假紀錄
• Tip: GetPersonalLeave.asp
• Tip: txtUserID
• type: iis5 AND NOT tags:"_grokparsefailure" AND
"GetPersonalLeave.asp" AND "txtUserID=70851"
22
收件匣清單程式
取得趕快核數量
個人請假報表清單程式
取得員工請假紀錄
計算工作誌列追事項數量
操作時間4
• 今年八月PA commit紀錄、只顯示日期、命令
• type: paloalto AND Type:CONFIG AND NOT
tags:_grokparsefailure AND Cmd:commit
23
操作時間5
• PA email密碼暴力嘗試紀錄
• type: paloalto AND Type:Threat AND ThreatID:"MAIL: User
Login Brute Force Attempt(40007)“
24
操作時間5
• PA email密碼暴力嘗試紀錄
• 沒看到IMAP!?
• type: paloalto AND Type:Threat AND ThreatID:"MAIL: User
Login Brute Force Attempt(40007)" AND NOT
(Application:smtp OR Application:pop3)
25
Visualize
26
27
Visualize-視覺化
• 建立視覺化搜尋
• 選定視覺化類型
• 設定呈現內容
• Y軸
• 加總, 計算, 統計
• X軸
• 分線, 分圖, 堆疊
• 站在自己肩膀上
• 儲存再利用
28
Area chart
• 以面積堆疊方式呈現結果
29
Data table
• 簡單來說 就是個表格
30
Line chart
• 可以想成面積個別不堆疊
31
Markdown widget
32
Metric
• 簡易計算結果呈現
• 加減乘除標準差
• 最大最小平均值
33
Pie chart
• 其實就是圓餅圖
34
Pie chart
• 其實就是圓餅圖
• 可以看更多
35
Tile map
• 資料型態需為geoip
36
Vertical bar chart
• 垂直霸圖
37
Vertical bar chart
• 垂直霸圖
• 分霸一下
• 比較霸氣
38
Visualize-視覺化
• 建立視覺化搜尋
• 選定視覺化類型
• 設定呈現內容
• Y軸
• 加總, 計算, 統計
• X軸
• 分線, 分圖, 堆疊
• 站在自己肩膀上
• 儲存再利用
39
操作時間
1. 用Mertic算出PA九月前七天傳輸總量(收/送/總和)
2. 用Data table做九月前七天傳輸總量來源IP前10名
3. 用Line chart做九月前七天傳輸總量來源IP前10名
4. 用Pie chart做九月前七天傳輸總量來源IP前10名
• 多展現該IP使用的Application
5. 自由發揮
40
操作時間1
• 前面就有囉
• 有認真聽嗎
41
操作時間2
• 用Data table做九月前七天傳輸總量來源IP前10名
42
• 用Line chart做九月前七天傳輸總量來源IP前10名
操作時間3
43
操作時間3
• 用Line chart做九月前七天傳輸總量來源IP前10名
44
操作時間4
• 用Pie chart做九月前七天傳輸總量來源IP前10名
45
操作時間4
• 用Pie chart做九月前七天傳輸總量來源IP前10名
• 多展現該IP使用的Application
46
Dashboard
47
Dashboard-儀錶板
• 要看的東西太多了
• IP 流量 應用程式 威脅數量 威脅種類 內容….
• 一個一個看視覺化會切到俗翹翹
• 看這個我已經忘了前一個是什麼
• 身為網管人,要「綜觀全局」
• 一次看多一點
48
Dashboard-儀錶板
49
• 視覺化做好要存檔
• 直接call來用比較快
Dashboard-儀錶板
50
• 可以拖放尺寸位置、做完記得存檔
操作時間
• 青菜蘿蔔各有所好,沒有絕對好壞對錯。
• 適合判讀的儀表,就是好儀表。
• 請由存檔的視覺,製作儀表並解釋其意義。
51
Conclusion
• Kibana結合Elasticsearch成為分析資料快速上手的工具
• 正確搜尋是一切根基
• Garbage in garbage out
• 基於搜尋建立有意義的視覺分析
• 日誌分析是最基本功能
• 每門日誌都是一門學問
• 匯聚有效的視覺分析,建立易於判讀的儀表板
52

More Related Content

What's hot

Materialized Column: An Efficient Way to Optimize Queries on Nested Columns
Materialized Column: An Efficient Way to Optimize Queries on Nested ColumnsMaterialized Column: An Efficient Way to Optimize Queries on Nested Columns
Materialized Column: An Efficient Way to Optimize Queries on Nested ColumnsDatabricks
 
Enabling Vectorized Engine in Apache Spark
Enabling Vectorized Engine in Apache SparkEnabling Vectorized Engine in Apache Spark
Enabling Vectorized Engine in Apache SparkKazuaki Ishizaki
 
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital KediaTuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital KediaDatabricks
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015PostgreSQL-Consulting
 
Dynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisationDynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisationOri Reshef
 
Speed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with AlluxioSpeed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with AlluxioAlluxio, Inc.
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화NAVER D2
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Databricks
 
Linux Binary Exploitation - Stack buffer overflow
Linux Binary Exploitation - Stack buffer overflowLinux Binary Exploitation - Stack buffer overflow
Linux Binary Exploitation - Stack buffer overflowAngel Boy
 
Spark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in Spark
Spark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in SparkSpark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in Spark
Spark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in SparkBo Yang
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
 
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroThe Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroDatabricks
 
How to Automate Performance Tuning for Apache Spark
How to Automate Performance Tuning for Apache SparkHow to Automate Performance Tuning for Apache Spark
How to Automate Performance Tuning for Apache SparkDatabricks
 
CDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkCDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkTimo Walther
 
Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...konok
 
SQL Performance Improvements At a Glance in Apache Spark 3.0
SQL Performance Improvements At a Glance in Apache Spark 3.0SQL Performance Improvements At a Glance in Apache Spark 3.0
SQL Performance Improvements At a Glance in Apache Spark 3.0Kazuaki Ishizaki
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsConnor McDonald
 

What's hot (20)

Materialized Column: An Efficient Way to Optimize Queries on Nested Columns
Materialized Column: An Efficient Way to Optimize Queries on Nested ColumnsMaterialized Column: An Efficient Way to Optimize Queries on Nested Columns
Materialized Column: An Efficient Way to Optimize Queries on Nested Columns
 
Enabling Vectorized Engine in Apache Spark
Enabling Vectorized Engine in Apache SparkEnabling Vectorized Engine in Apache Spark
Enabling Vectorized Engine in Apache Spark
 
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital KediaTuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
Tuning Apache Spark for Large-Scale Workloads Gaoxiang Liu and Sital Kedia
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
 
Dynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisationDynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisation
 
Speed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with AlluxioSpeed Up Uber's Presto with Alluxio
Speed Up Uber's Presto with Alluxio
 
[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화[2D1]Elasticsearch 성능 최적화
[2D1]Elasticsearch 성능 최적화
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
 
Linux Binary Exploitation - Stack buffer overflow
Linux Binary Exploitation - Stack buffer overflowLinux Binary Exploitation - Stack buffer overflow
Linux Binary Exploitation - Stack buffer overflow
 
Spark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in Spark
Spark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in SparkSpark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in Spark
Spark Shuffle Deep Dive (Explained In Depth) - How Shuffle Works in Spark
 
Elk
Elk Elk
Elk
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroThe Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
 
How to Automate Performance Tuning for Apache Spark
How to Automate Performance Tuning for Apache SparkHow to Automate Performance Tuning for Apache Spark
How to Automate Performance Tuning for Apache Spark
 
CDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkCDC Stream Processing with Apache Flink
CDC Stream Processing with Apache Flink
 
Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...
 
SQL Performance Improvements At a Glance in Apache Spark 3.0
SQL Performance Improvements At a Glance in Apache Spark 3.0SQL Performance Improvements At a Glance in Apache Spark 3.0
SQL Performance Improvements At a Glance in Apache Spark 3.0
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tips
 
Optimizing Hive Queries
Optimizing Hive QueriesOptimizing Hive Queries
Optimizing Hive Queries
 

Similar to ELK Stack - Kibana操作實務

Elastic stack day-1
Elastic stack day-1Elastic stack day-1
Elastic stack day-1YI-CHING WU
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeAngel Boy
 
Introduction to big data
Introduction to big dataIntroduction to big data
Introduction to big data邦宇 叶
 
⼤語⾔模型 LLM 應⽤開發入⾨
⼤語⾔模型 LLM 應⽤開發入⾨⼤語⾔模型 LLM 應⽤開發入⾨
⼤語⾔模型 LLM 應⽤開發入⾨Wen-Tien Chang
 
改善Programmer生活的sql技能
改善Programmer生活的sql技能改善Programmer生活的sql技能
改善Programmer生活的sql技能Rack Lin
 
Binary exploitation - AIS3
Binary exploitation - AIS3Binary exploitation - AIS3
Binary exploitation - AIS3Angel Boy
 
做自己的可可豆夾 @ cocoahead.tw
做自己的可可豆夾 @ cocoahead.tw做自己的可可豆夾 @ cocoahead.tw
做自己的可可豆夾 @ cocoahead.twKai-Yuan Cheng
 
Comment System of 56.com
Comment System of 56.comComment System of 56.com
Comment System of 56.comHo Kim
 
网站离线数据安全分析漫谈 2012cert
网站离线数据安全分析漫谈 2012cert网站离线数据安全分析漫谈 2012cert
网站离线数据安全分析漫谈 2012certph4nt0m
 
Data Analyse Black Horse - ClickHouse
Data Analyse Black Horse - ClickHouseData Analyse Black Horse - ClickHouse
Data Analyse Black Horse - ClickHouseJack Gao
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介pan weizeng
 
scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎Ping Yin
 
合久必分,分久必合
合久必分,分久必合合久必分,分久必合
合久必分,分久必合Qiangning Hong
 
Template mb-kao
Template mb-kaoTemplate mb-kao
Template mb-kaoxwcoder
 
QCon - 一次 Clojure Web 编程实战
QCon - 一次 Clojure Web 编程实战QCon - 一次 Clojure Web 编程实战
QCon - 一次 Clojure Web 编程实战dennis zhuang
 
淘宝网前台应用性能优化实践
淘宝网前台应用性能优化实践淘宝网前台应用性能优化实践
淘宝网前台应用性能优化实践丁 宇
 

Similar to ELK Stack - Kibana操作實務 (20)

Elastic stack day-1
Elastic stack day-1Elastic stack day-1
Elastic stack day-1
 
Linux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledgeLinux binary Exploitation - Basic knowledge
Linux binary Exploitation - Basic knowledge
 
Introduction to big data
Introduction to big dataIntroduction to big data
Introduction to big data
 
⼤語⾔模型 LLM 應⽤開發入⾨
⼤語⾔模型 LLM 應⽤開發入⾨⼤語⾔模型 LLM 應⽤開發入⾨
⼤語⾔模型 LLM 應⽤開發入⾨
 
改善Programmer生活的sql技能
改善Programmer生活的sql技能改善Programmer生活的sql技能
改善Programmer生活的sql技能
 
Binary exploitation - AIS3
Binary exploitation - AIS3Binary exploitation - AIS3
Binary exploitation - AIS3
 
做自己的可可豆夾 @ cocoahead.tw
做自己的可可豆夾 @ cocoahead.tw做自己的可可豆夾 @ cocoahead.tw
做自己的可可豆夾 @ cocoahead.tw
 
Comment System of 56.com
Comment System of 56.comComment System of 56.com
Comment System of 56.com
 
网站离线数据安全分析漫谈 2012cert
网站离线数据安全分析漫谈 2012cert网站离线数据安全分析漫谈 2012cert
网站离线数据安全分析漫谈 2012cert
 
Win dbg入门
Win dbg入门Win dbg入门
Win dbg入门
 
Windbg入门
Windbg入门Windbg入门
Windbg入门
 
Spark tutorial
Spark tutorialSpark tutorial
Spark tutorial
 
Data Analyse Black Horse - ClickHouse
Data Analyse Black Horse - ClickHouseData Analyse Black Horse - ClickHouse
Data Analyse Black Horse - ClickHouse
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介
 
Javascript
JavascriptJavascript
Javascript
 
scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎scrapy+sphinx搭建搜索引擎
scrapy+sphinx搭建搜索引擎
 
合久必分,分久必合
合久必分,分久必合合久必分,分久必合
合久必分,分久必合
 
Template mb-kao
Template mb-kaoTemplate mb-kao
Template mb-kao
 
QCon - 一次 Clojure Web 编程实战
QCon - 一次 Clojure Web 编程实战QCon - 一次 Clojure Web 编程实战
QCon - 一次 Clojure Web 编程实战
 
淘宝网前台应用性能优化实践
淘宝网前台应用性能优化实践淘宝网前台应用性能优化实践
淘宝网前台应用性能优化实践
 

ELK Stack - Kibana操作實務

Editor's Notes

  1. ERP 1,506,249 type: apache AND NOT tags:"_grokparsefailure" 2016-01-20 00:00:00.000 2016-04-21 00:00:00.000 假單 28,482,059 type: iis5 AND NOT tags:"_grokparsefailure“ 2013-12-30 00:00:00.000 2016-02-20 00:00:00.000