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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...