Splunk Search

How do I divide each value in this row by a value in one of the columns?

jhayIV
Engager

How would I divide each value in this row by the count(CMDB SERVER) calc?
alt text

Tags (3)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Assuming the columns are dynamic you'll want to use foreach:

... | rename "count(CMDB SERVER)" as cmdb | foreach count* [eval <<FIELD>> = '<<FIELD>>' / cmdb] | rename cmdb as "count(CMDB SERVER)"
0 Karma

jluo_splunk
Splunk Employee
Splunk Employee

You can use the eval command to create a new columns or modify the values of the current columns (documentation here: http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/eval)

Renaming your columns will make the eval strings a bit neater, for example..

... | rename "count(CMDB Server" as "CMDB_Server", "count(CMDB APP)" as "CMDB_App" | eval CMDB_App = CMDB_App/CMDB_Server

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