Splunk Search

How do I perform eval function on chart values?

Romeo_James
Engager

Example Search:
Index=*
|chart count over Character
|addcoltotals

Example output:

Char ........Count

A.................21
B.................13
C.................54
D.................11
....................99


Is it possible to take the addcoltotals and divide it by the value of C (54/99) using an eval func?

0 Karma
1 Solution

renjith_nair
SplunkTrust
SplunkTrust

@Romeo_James ,

Try,

    index=*
   |chart count over Character
   |eventstats sum(count) as Total
   |addcoltotals
   |eval X=if(Character=="C",count/Total,"")|fields - Total

You can remove the condition, if you want the values for all characters

Happy Splunking!

View solution in original post

renjith_nair
SplunkTrust
SplunkTrust

@Romeo_James ,

Try,

    index=*
   |chart count over Character
   |eventstats sum(count) as Total
   |addcoltotals
   |eval X=if(Character=="C",count/Total,"")|fields - Total

You can remove the condition, if you want the values for all characters

Happy Splunking!
Get Updates on the Splunk Community!

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 ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...