Splunk Search

How to plot cumulative stack timechart ?

meamitjain
New Member

Hello, I have timechart by location requirement. Also client want to see the cumulative value on the stacked bar so that he dont have to add up numbers to find total of that minute. Is there a formatting option on chart or something I could do within the query.

Thanks
Amit

Tags (1)
0 Karma

kristian_kolb
Ultra Champion

The following example shows how you can add fields numerically (never mind that it does not add hours and minutes correctly, the point is to demonstrate addition through the eval command, with data that is available on every splunk instance)

index=_internal  | head 3| eval hm = date_hour + date_minute| eval hms= hm + date_second|  table time date_hour date_minute date_second hm hms

As you can see, the table contains the original fields as well as the computed ones.

To remove fields you do not want - add the | fields - fieldname1 fieldname2 etc to the end of the search.

To present the table as a graph, press the 'Results Chart' icon (looks like a small bar-chart, just below where it says "X matching results". There you can play around with various options, such as stacking etc.

You could/should perhaps also take a look at the proper charting commands, such as chart and timechart. Or stats, which may also prove useful.

hope this helps,

Kristian

0 Karma

meamitjain
New Member

sample events count:
Time,Location1,Location2,Location3
12:31,30,40,50
12:32,40,50,60
12:33,20,30,40

sample output expected:
Time,Location1,Location2,Location3
12:31,30,70,120
12:32,40,90,150
12:33,20,50,90

On stacked chart I want to show the values as cumulative.

Hope this helps.

0 Karma

kristian_kolb
Ultra Champion

please provide more information. sample events. sketch of desired output.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...