Splunk Search

stats sum?

efelder0
Communicator

From my list of field in Splunk, I have three fields with numeric values that I would like to add together and assign the total to a field called "Total_Threat_Count".

i.e. - Critical_Severity = 50 + Medium_Severity = 25 + Low_Severity = 25 AS Total_Threat_Count (100)

What would the stats command that would work best here.

I have tried stats sum(Critical_Severity, Medium_Severity, Low_Severity) AS Total_Threat_Count, but I am getting a blank value for that field.

Tags (1)
0 Karma

cphair
Builder

I think you want to use eval here. Something like

... | eval Total_Threat_Count=Critical_Severity + Medium_Severity + Low_Severity | table host, Total_Threat_Count

should work.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...