iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 20
0
Elastic Stack on Cloud

前端三分鐘 X Elastic Stack系列 第 20

Elastic Machine Learning Quick Start: 零基礎也能使用的機器學習工具 (20)

這篇文章會示範如何設定與使用 Elastic Machine Learning (機器學習),機器學習讓我們能夠更快的分析與了解資料的狀況,提供異常的告警,甚至是未來數據的預測。

Elastic Machine Learning

如果只是啟用而沒有進行相關配置的話就能夠單純的看到目前資料的相關統計

  • 連到 kibana

  • Management ➔ License Management 開始 30 天試用

    開啟 30 天試用
    https://ithelp.ithome.com.tw/upload/images/20200922/20130026g2tBzFD6ua.jpg

  • 啟用之後就可以先用 ML 的資料視覺化工具看目前資料狀況

  • Machine Learning ➔ Data Visualizer

  • 選取想要查看的 Index

    選取 Index
    https://ithelp.ithome.com.tw/upload/images/20200922/20130026Y24G1Zkp5a.jpg

    相關統計資料,先點選 Use full filebeat-* data
    https://ithelp.ithome.com.tw/upload/images/20200922/20130026MD82p4an6n.jpg

    詳細到可以看出從哪個網域、IP 連進來的
    https://ithelp.ithome.com.tw/upload/images/20200922/201300264IMpUW8igc.jpg

Elastic Machine Learning Job

要進行機器學習分析,首先我們要建立一個 Job 去偵測可疑的登入行為,建立前要先預備資料,因為這次只需要 failed 或是 invalid 的資料,先到 Discover 透過 filter 設定以下篩選條件,最後記得把這個 Search 的結果儲存。

  • system.auth.ssh.event
  • is one of
  • [Failed, Invalid]

設定篩選條件
https://ithelp.ithome.com.tw/upload/images/20200922/20130026dbbL7k7bdz.jpg

然後就可以按教學影片去建立一個 Job,這裡提供舊版的影片,包含 Single MetricMulti Metric 的過程,實際上流程差不多只是介面上稍有不同,這裡也簡單操作一次步驟如下:

  • 從側面選單到 Machine Learning

  • 在 Overview tab 選擇 Create Job

  • 選擇我們剛剛儲存的 Search

    https://ithelp.ithome.com.tw/upload/images/20200922/20130026Y24G1Zkp5a.jpg

  • 選擇時間區間的時候預設可能會沒有資料,可以先點選 Use full filebeat-* data

    https://ithelp.ithome.com.tw/upload/images/20200922/20130026dygPdZofKo.jpg

  • 選擇 Use a wizard 中的 Single 或是 Multi Metric

    https://ithelp.ithome.com.tw/upload/images/20200922/201300269NSA97AOJz.jpg

  • Pick fields 欄位選 High count (Event rate)

  • Bucket Span 填 5m: 每次迭代運算的時間間隔

    https://ithelp.ithome.com.tw/upload/images/20200922/20130026gULmvzXNyg.jpg

  • Multi 可以多配置

    • Split field: system.auth.hostname,設置後會自動加入 influencers
    • influencers: 可以補上 system.auth.user 及 system.auth.ssh.ip
      • 讓抓到兇手更簡單
      • 讓結果更簡化聚合
  • 在 Job ID 給一個命名

    https://ithelp.ithome.com.tw/upload/images/20200922/20130026IvYlcN8tUc.jpg

  • 最後執行這個 Job

  • 結果會包含計算權重分數,透過圖表標示異常值

    權重分數在左側
    https://ithelp.ithome.com.tw/upload/images/20200922/20130026DfT7PUSx5O.jpg

    標示異常值
    https://ithelp.ithome.com.tw/upload/images/20200922/20130026Eu8d0rjC1N.jpg


上一篇
Elastic SIEM 基礎: SIEM 究竟能夠幫我們解決什麼問題 (19)
下一篇
Elastic Machine Learning 基礎: 機器學習的名詞、相關流程與案例介紹 (21)
系列文
前端三分鐘 X Elastic Stack31
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言