Splunk Search

各フィールドのデータを集計し、timechartで期間ごとのデータに纏めたい

tonakano
Engager

ご教授ください。

複数のフィールドにそれぞれの集計数が設定されています。
これの一部を集計し、timechartで表現したいのですが、フィールドの中身の合算する方法が分かりません。

・やりたいこと例
以下のフィールドを持つ
A,B,C,D,E
個々のフィールドは任意の数値が設定されており、デイリーで1月分のデータを使用する。
これから、A,Cの中身の集計値をα、B,Dの中身の集計値をβとする。(フィールドEは集計外)
この集計値αとβをtimechartで日付ごとのグラフに表したい。

但し、日単位でデータを持っているが、日によってAしかないレコード、BCDしかないレコードなどが混在しているため
eval sum_a = A + C
eval sum_b = C + D
とやると集計が出来ません。

宜しくお願いします。

Tags (1)
0 Karma
1 Solution

to4kawa
Ultra Champion
base search
|table _time A B C D
|fillnull A,B,C,D
|timechart span=1d sum(eval(A+C)) as sum_ac sum(eval(B+D)) as sum_bd

こちらでいかがでしょうか。

View solution in original post

0 Karma

to4kawa
Ultra Champion
base search
|table _time A B C D
|fillnull A,B,C,D
|timechart span=1d sum(eval(A+C)) as sum_ac sum(eval(B+D)) as sum_bd

こちらでいかがでしょうか。

0 Karma

tonakano
Engager

ありがとうございます。いけそうです。

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...