Dashboards & Visualizations

How to plot a barchart based on String rather than numbers

sangs8788
Communicator

Hi,

I have events with below format,

08/09/202109:27:00 +0000, search_name=sre_slo_BE_module_priority_monthly, search_now=1628501220.000, info_max_time=1628501220.000, info_search_time=1628501221.635, Module=InvoiceManagement, Priority=P4, LastViolationMonth="Jul-2021", MissedCount=1, LastViolationp90ResponseTime (s)="30.44", Deviation (%)="1.5"

I would like to plot a graph which would have Y axis with values as P1, P2, P3, P4 & x axis with Month.

I tried using below query to plot a graph by assigning values to the Priorities. But again, the Y axis becomes based on the Values assigned to the Priority rather than Priority itself.

 

index=summary source=sre_slo_BE_module_priority_monthly  Module="ControlCenter"
| eval convert_epoch = strftime(_time,"%m-%d-%Y")
| eval prevMonth=lower(strftime(relative_time(_time,"-1mon@d"),"%B"))
| eval MonthYear = prevMonth + "-" + date_year
| search convert_epoch!="08-01-2021"
| eval PriorityValue = case(Priority="P1", 4, Priority="P2", 3, Priority="P3", 2, Priority="P4", 1)
| stats values(PriorityValue) as PriorityValue by MonthYear, Priority

 

Below is the graph which I get. Instead of PriorityValue on the Y axis, I need Priority itself.

Screenshot (3).png

Could someone please help me out here

@kamlesh_vaghela @diogofgm  Is this something which you can assist with. Appreciate if you can help on this

Thanks

Labels (1)
Tags (1)
0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...