Splunk Search

How to include x axis info on chart

kbcuait
Explorer

Hi, I have created a results chart using this search:

| dbquery "DBNAME" "SELECT useraction FROM usertable" | eval useraction=strftime(useraction,"%Y-%d-%m") | stats count by useraction

However there are no dates along the x axis, only the title of "useraction"

How can I get those there for context?

Thanks 🙂

Tags (3)
0 Karma

lguinn2
Legend

I am not sure that this will work, but try

| dbquery "DBNAME" "SELECT useraction FROM usertable" 
| eval useraction=strftime(useraction,"%Y-%d-%m")
| eval _time=strptime(useraction,"%Y-%d-%m")
| timechart span=5m count

Hopefully, this will build a timechart with 5 minute increments. You can set the span to something else if you want, but there is a limit to the number of datapoints that can be displayed in a chart. I forget what the limit it, but you should get an error message (red bar) if you try to exceed it.

0 Karma

kbcuait
Explorer

Hi and thanks - this gives me No results found

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...