Splunk Search

timechart

mm12
Explorer

Hi,

I am just taking the total count of incident using stats command form the json and the query is working fine. But when I using timechart command it is not giving me the visualization. Please anyone help me on this.

index=incident_index  source="/mi_data/dc_in_events.json" | spath path=Incident__Number output=INC | stats values(*) as * by INC | stats count(Incident__Number)

Thanks

 

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

How are you trying to add timechart to this search?

You're already doing stats and getting a single number so there is nothing to make timechart from.

BTW, you calculate stats values(*) but then only use one of those fields. Instead of doing all this, just doing

| stats dc(Incident_Number)

Instead of both stats would be enough.

About the timechart - it's not clear what you want to do. Can you explain it?

0 Karma

mm12
Explorer

@PickleRick - I am using below query for time chart instead of stats command but it is not working.

index=incident_index  source="/mi_data/dc_in_events.json" | spath path=Incident__Number output=INC | stats values(*) as * by INC | timechart count 

Thanks

Tags (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

Well, if you do your stats, you lose the _time field because you're aggregating data over values of INC. You might have a multivalued field containing all values of _time in one row but that's just one row, so there's no basis for timechart.

What do you want to chart? Tell us with your own words, not with SPL.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...