Splunk Search

joinできなかった結果を含めて表示する方法はないでしょうか

kaoriaraki
Explorer

先週と今週の結果を比較するサーチを実行したいと考えています。
下記の例では曜日をキーにjoinして比較していますが、週の半ば(例えば水曜日)にサーチを実行すると水曜日までのグラフしか表示されません。
先週分は、日曜日から土曜日までの1週間分を表示し、今週分はサーチを実行した曜日までの結果を表示する方法がありましたらご教示ください。

index=_internal earliest=@w0 source=metric group=per_index_thruput series=_audit |timechart span=1d sum(ev) as 今週 values(date_wday) as wday |join wday [search index=_internal earliest=-1w@w0 latest=@w0 source=metric group=per_index_thruput series=_audit |timechart span=1d values(date_wday) as wday sum(ev) as 先週|fields - _time] |fields - wday

joinでは実現出来ない場合、他の方法をアドバイスいただけると助かります。

1 Solution

kaoriaraki
Explorer

joinを使って比較する方法はわかりませんでしたが、appendcolsを使って曜日毎に比較することが出来ました。

index=_internal earliest=@w0 latest=@w0+7d source=metric group=per_index_thruput series=_audit |timechart span=1d sum(ev) as thisWeek values(date_wday) as wday |appendcols [search index=_internal earliest=-1w@w0 latest=@w0 source=metric group=per_index_thruput series=_audit |timechart span=1d values(date_wday) as wday sum(ev) as lastWeek |fields - _time] |chart list(_time) as _time list(thisWeek) as 今週 list(lastWeek) as 先週 by wday |sort _time|fields - wday

View solution in original post

0 Karma

kaoriaraki
Explorer

joinを使って比較する方法はわかりませんでしたが、appendcolsを使って曜日毎に比較することが出来ました。

index=_internal earliest=@w0 latest=@w0+7d source=metric group=per_index_thruput series=_audit |timechart span=1d sum(ev) as thisWeek values(date_wday) as wday |appendcols [search index=_internal earliest=-1w@w0 latest=@w0 source=metric group=per_index_thruput series=_audit |timechart span=1d values(date_wday) as wday sum(ev) as lastWeek |fields - _time] |chart list(_time) as _time list(thisWeek) as 今週 list(lastWeek) as 先週 by wday |sort _time|fields - wday

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

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