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!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...