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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...