I want to create chart that compare single values daily.
for example want to compare (about 30 different product codes) that exist in my log (today vs yesterday), and visualize it with Trellis where as show compare each code on separate chart (for today and yesterday)
expected chart (separate by product code=100 and product code=200 😞
I write SPL like this:
index="myindex" | timechart count by code span=1h | timewrap d
but it combine them and show count of all product code in same chart and separate it by date!
yes it's not difficult but I want to use it for other fields too that some of them might be increase up to 100 different items!
like this: product code=30, product id=100, product tag=80, and so on ...
I need to find a way splunk automatically create this chart because when new field add automatically add to this dashboard
Actually my problem is this how can i generate them automatically not limitation number of chart on a single page!
Let me declare Imagine i have 10 chart, now problem is how can i create them automatically without create manually!
@indeed_2000 try making use of Splunk's internal fields date_mday and date_hour. Following is a run anywhere example based on Splunk's _internal index.
index=_internal sourcetype=splunkd earliest=-1d@d latest=now component IN ("UIAuth","WatchedFile","Metrics","PeriodicHealthReporter","LMStackManager") | eval date_hour=printf("%02d",date_hour) | stats count by date_hour date_mday component | eval date_mday=if(date_mday!=strftime(now(),"%Y/%m/%d"),"Yesterday","Today")
In your case try the following and confirm!
index="myindex" | eval date_hour=printf("%02d",date_hour) | stats count by date_hour date_mday code | eval date_mday=if(date_mday!=strftime(now(),"%Y/%m/%d"),"Yesterday","Today")