Splunk Search

Trellis multi value by date

mehrdad_2000
Path Finder

Hi
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 😞
alt text

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!
any recommendation?

Thanks

0 Karma

to4kawa
SplunkTrust
SplunkTrust

![alt text][1]

0 Karma

mehrdad_2000
Path Finder

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

0 Karma

to4kawa
SplunkTrust
SplunkTrust

Do you want to look a hundred items?

see @rich7177 answer
https://answers.splunk.com/answers/529004/is-there-a-way-to-display-more-than-20-charts-at-a.html
and try another way.

0 Karma

mehrdad_2000
Path Finder

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!

0 Karma

to4kawa
SplunkTrust
SplunkTrust

I see , I'm sorry to waste your time.

0 Karma

mehrdad_2000
Path Finder

No no I don’t mean you waste my time 🙂
BTW thank you for your answer.

0 Karma

to4kawa
SplunkTrust
SplunkTrust

![alt text][1]

0 Karma

mehrdad_2000
Path Finder

as I mention overlay chart not separate chart for today and yesterday, need to both of them in single chart for each code.

0 Karma

to4kawa
SplunkTrust
SplunkTrust

![edited]

0 Karma

mehrdad_2000
Path Finder

it create several empty chart and separate them each 30 minutes!

0 Karma

to4kawa
SplunkTrust
SplunkTrust

default Splunk can't display Trellis what you want.
make dashboard , use base search and display two chart.

0 Karma

mehrdad_2000
Path Finder

two chart? as I mention about 30 product codes, means 30 chart and might be increase depend on data that's why i use Tellis.

0 Karma

niketnilay
Legend

@mehrdad_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")
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

mehrdad_2000
Path Finder

i try both, but neither of them create chart like what i describe in post.
need overlay chart for compare yesterday and today for each code in Trellis.

0 Karma
.conf21 CFS Extended through 5/20!

Don't miss your chance
to share your Splunk
wisdom in-person or
virtually at .conf21!

Call for Speakers has
been extended through
Thursday, 5/20!