Dashboards & Visualizations

Rename Label names on X axis in a column / barchart

pal4life
Path Finder

Hi,
Currently my labels on X axis are 2017-01-31T23:59:01.000-06:00 in the visualization, I am wondering have can I Change this and accordingly the other future month ones to January, February etc.

Thanks

0 Karma

woodcock
Esteemed Legend

Make sure that you time field is called _time and that you have used span=1mon and, if possible, call timechart as the last command (it has special MoJo for X-axis labeling that does this for you).

Also, check out this Q&A:
https://answers.splunk.com/answers/320303/how-to-rename-the-time-along-the-x-axis-of-my-time.html#an...

0 Karma

cmerriman
Super Champion

you should be able to do something like before your chart :

|eval month=strftime(_time,"%B") if you just want the month name
|eval monthYear=strftime(_time,"%Y, %B") if you want the year with the month name

and then chart by month or monthYear. if you NEED to chart the way you're currently doing it, you might be able to do a foreach command:

|foreach *-* [eval <<FIELD>>=strftime('<<FIELD>>',"%B")
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...