Splunk Search

timechart not showing any result while tstat does

unitrium
Explorer

Hi ,

I'm trying to build a single value dashboard for certain metrics. I would like to put it in the form of a timechart so I can have a trend value.

However this search gives me no result :

 

 

 

| tstats `summariesonly` min(_time) as firstTime,max(_time) as lastTime,count from datamodel=Vulnerabilities.Vulnerabilities by Vulnerabilities.signature,Vulnerabilities.dest, Vulnerabilities.severity | `drop_dm_object_name("Vulnerabilities")` | where firstTime!=lastTime AND severity!="informational" | eval age=round((lastTime-firstTime)/86400) | timechart span=30d avg(age) by lastTime

 

 

 


Which is strange because I feel like this command is almost the same :

 

 

 

| tstats `summariesonly` min(_time) as firstTime,max(_time) as lastTime,count from datamodel=Vulnerabilities.Vulnerabilities by Vulnerabilities.signature,Vulnerabilities.dest, Vulnerabilities.severity | `drop_dm_object_name("Vulnerabilities")` | where firstTime!=lastTime AND severity!="informational" | eval age=round((lastTime-firstTime)/86400) | bucket lastTime span=30d | stats avg(age) by lastTime

 

 

 

And this one returns me the results that I want. Could anybody help me out getting a timechart out of this ?

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

timechart is looking to use _time so try

... | eval age=round((lastTime-firstTime)/86400) | eval _time=lastTime | timechart span=30d avg(age)

 

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

timechart is looking to use _time so try

... | eval age=round((lastTime-firstTime)/86400) | eval _time=lastTime | timechart span=30d avg(age)

 

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...