Splunk Search

Can't get my chart to sort

peterimbery
Engager

Here is my query

index="myIndex" AND host="myHost" AND ObjectName="myObjectName"
| eval secondsEpoch = GroupDateTime/1000
| eval displayDate=strftime(secondsEpoch,"%m-%d %H:%M")
| chart sum(RecordCount) over CallingClass by displayDate
| sort 0 -GroupDateTime
alt text

GroupDateTime is a time that I am logging to splunk it contains an epoch time in milliseconds.

No matter how I sort my data it comes out looking like this. What I want is the latest date on the left column. I have even tried to chart by CallingClass over GroupDateTime and that doesn't work either. I even tried _time.

I have tried for several days to get this to work and can't find a solutions. I suspect it is probably something easy.
I am new to splunk so some solutions I didn't understand or couldn't get to work.

0 Karma
1 Solution

to4kawa
Ultra Champion
index="myIndex" AND host="myHost" AND ObjectName="myObjectName"
| eval secondsEpoch = GroupDateTime/1000
| eval displayDate=strftime(secondsEpoch,"%m-%d %H:%M")
|chart limit=0 useother=f usenull=f sum(RecordCount) as RecordCount by displayDate CallingClass
|sort 0 - displayDate
|transpose 0 header_field=displayDate column_name=CallingClass

View solution in original post

to4kawa
Ultra Champion
index="myIndex" AND host="myHost" AND ObjectName="myObjectName"
| eval secondsEpoch = GroupDateTime/1000
| eval displayDate=strftime(secondsEpoch,"%m-%d %H:%M")
|chart limit=0 useother=f usenull=f sum(RecordCount) as RecordCount by displayDate CallingClass
|sort 0 - displayDate
|transpose 0 header_field=displayDate column_name=CallingClass

peterimbery
Engager

That's the ticket! Thank you so much! Now I can look into the things I don't understand and learn from this!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...