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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...