看月份的波幅

其實一個好簡單的就是看HSI 按月份的波幅去衡量大市指標

Splunk 其實一些 default field (例如 _time, date_month

https://docs.splunk.com/Documentation/Splunk/7.0.2/Knowledge/Usedefaultfields


以下是簡單的code
index=index code=hsi
| eventstats  max(close) as max_close min(close) as min_close BY date_month
| dedup date_month
| eval range = max_close - min_close
 | eval monthnum=strftime(_time,"%y%m")
| sort monthnum
| table date_month, range


其實可用Stats, 但eventstats 同stats 的分別就是保留其實數據
如果用stats ,之後的result set 只會有max_close, min_close, date_month
但date_month 本身不會排 (可能二月February 會比September 後)
所以加多monthnum field 再去sort






留言