Splunk Search

How to color columns based on a variable?

anakelka
New Member

I am charting a Product ID v/s count in a column chart
I want to color the columns in red and green. Red if the PID is X and green if PID is NOT_X
I dont want X and NOT_X to show on the axis or legend.
Is there a conditional chart statement that I can use?

0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

Have you taken a look at the Splunk 6.x Dashboard examples app, available on Splunkbase?

https://splunkbase.splunk.com/app/1603/

This is a great app for learning how to do different types of visualizations.

alt text

For each example, you can see the XML for the dashboard, as well as any javascript or css that is required for that example.

0 Karma

anakelka
New Member

I am unable to access the URL

0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

Try it now. Or go to splunkbase.com and search for dashboard examples.

0 Karma

anakelka
New Member

I could access it but somehow I am not sure it answers my question.....I want to color the graph based on another variable settings......almost like an if loop for the chart

0 Karma

somesoni2
SplunkTrust
SplunkTrust

What is your search?

0 Karma

anakelka
New Member

| eval LDOS = case(ldos<0,"PID_LDOS",(ldos>0 OR ldos=0),"PID_NOT_LDOS") | search LDOS=X| chart values(SR) over itemShipped
0


column
{"values(SR)":0x73A550}

When the search is X I want the chart to show Red
When the search is "NOT_X" I want the chart to show green....I am plotting value(SR) and itemShipped.
I could not access the URL mentioned above

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...