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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

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 ...