Splunk Search

colour format in chart based on the list

iamniks
Explorer

Hi, I have a table

DATE AMOUNT
07/22/2014 1000
07/23/2014 2000
08/01/2014 500

and so on.

I have to get a bar chart of decreasing amount and date. which is easy. Now i have to represent the latest date in that chart in a different colour. Is that possible

Tags (2)
0 Karma

somesoni2
Revered Legend

Give this a try.

Your search giving fields DATE, AMOUNT | eval LATEST=strptime(DATE,"%m/%d/%Y") 
| eventstats max(LATEST) as LATEST1 | eval LATESTAMT=if(LATEST=LATEST1,AMOUNT,0) | eval AMOUNT=if(LATEST=LATEST1,0,AMOUNT)| table DATE, AMOUNT, LATESTAMT 

Use this to generate a stacked bar chart and for the latest record it should show in different color (with different series name 'LATESTAMT')

0 Karma

iamniks
Explorer

many. it will keep updating the list on when a transaction happens on that date. so i need a query to find the latest date in the list at any point in time

0 Karma

somesoni2
Revered Legend

How many rows can be there in the table?

0 Karma

MuS
Legend

Hi iamniks,

Yes, you can do this - but you need to tweak some css and js files to achieve this. See this http://answers.splunk.com/answers/83206/color-in-a-table-based-on-values or this app http://apps.splunk.com/app/570/.

hope this helps ...

cheers, MuS

0 Karma

iamniks
Explorer

thanks for the response but we can use the above if we know what is the expected value but in my case i dont know what is the latest date in the list

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...