Yet another bootstrap theme.

2021-01-26
splunk-cim

  • 列出目前系統中有的 CIM

    • 於 web 中 search | datamodelsimple type=models
  • 確定要符合那種 data model

  • 接著設定 data model

    • 由 Settings -> Data models -> 選對應的 data model
    • 進行 tag 的設定
      • 由 Settings -> Event Types 進行新增
      • 透過設定檔, app/default/tags.conf
  • 建立需要的 lookup table

    • 可以由 | inputlookup lookup_defintion 可以看到 lookup 的定義
    • 定義 lookup table
    • 設定 lookup 欄位定義
  • 設定 lookup 欄位的步驟

    • 建立 & copy csv 檔案
      • 檔案放置於, app/lookup 目錄中
    • 定義 lookup define 資料
      • 編輯檔案,app/default/transforms.conf
    • 使用 lookup 來 alias 欄位
      • 編輯檔案,app/default/props.conf
  • regex

  • 進行 CIM validate 的工具

一些筆記

  • Two Knowledge Objects included in the CIM

    • Tags
    • Fields
  • Process for Tags

    • Identity
      • identity the data model and dataset revelant to your event
    • Observe
      • Which Tags are required for the dataset ?
      • Are there any constraints ?
    • Apply
      • create event types and tag them with the appropriate tags
    • Verify
      • verify the tags work as expected using Pivot tool
  • Process of Fields

    • Compare the fileds in the data model with the fields in your data
    • Map your fields name to the CIM filed names
      • Aliases
      • Extractions
      • Lookups
  • Two Way to validate your data

    • using the Pivot editor
    • searching the data model itself
  • Six steps in the data normalization pipeline

    • get data in
    • examine data
    • tag events
    • verify tags
    • normalize field
    • validate against data model

Reference

Read More

2021-01-25
python-flow-base

一個滿有趣的 python 工具

Read More

2021-01-14
aws-api-gateway-401

最近遇到一個 api-gateway 回 401 的情形,追查之後覺得有可能是 identity sources 傳空值造成的

  • For request parameter-based authorizers, the error generally occurs when configured identity sources are missing, null, empty, or invalid.

Reference

Read More

2021-01-14
splunk-packaging

列出使用 Splunk Packaging Toolkit 的記錄

cmd document

cmd list

  • cmd: slim, slim <command> --help
  • slim generate-manifest
  • slim package
    • slim package [-h] [--debug] [--quiet] [-o <output-dir>] [-r <repository>] [-u <level>] <app-source>
  • slim validate

Reference

Read More

2021-01-14
useful_splunk_cmd

列出,常用的 splunk cmd 作為參考用

command

Read More

2021-01-06
aws-smtp-server

在測試 splunk 時,要用 email alert 時,需要先設定 smtp server
因為現在公司的 smtp server 現在滿多的,也不容易找到外部的 smtp server 可以用,就用 aws smtp service 囉

簡單的流程 log

  • 申請 smtp credentials,有分 region
  • 要用來發現的 email (mail from),需要先經過驗證

Reference

Read More

2021-01-06
splunk-email-notification

記錄使用 email 來收 splunk alert 時,遇到的情形

修改 mail notificition 的相關設定

Trouble Shooting

Read More

2021-01-06
splunk-trouble-shooting

最近在測試使用 splunk app,要 trouble shooting 需要花些功夫

splunk log path

  • $SPLUNK_HOME/var/log/splunk folder 中,有需要的 log folder
    • for example /opt/splunk/var/log/splunk, linux 中的 path

可以 trouble shooting 的方式

  • 使用 query 的方式
    1
    index=_internal " error " NOT debug source=*splunkd.log* earliest=-24h latest=now
Read More

2020-12-17
develop-Splunk-Apps

記錄一下,要開發 splunk app 時,需要閱讀的資料 & 閱讀的記錄

Visualize data in a Splunk app for Splunk Cloud or Splunk Enterprise

開發工具

一些可以先事前看看的文件

Splunk conf material

publish

Debug

大神的 blog

教學 site

Reference

Read More

2020-12-17
Splunk-AppInspect

List Splunk AppInspect 的相關資料,當寫好一個 splunk app 時,可以使用 AppInspect 檢查 app 的寫法是否符合 splunk 的 specs

sample command

$ splunk-appinspect inspect --included-tags splunk_appinspect $SPLUNK_HOME/etc/apps/[SPLUNK_APP_NAME]

Reference

Read More