Splunk Search

How to add values and count of a field and use them in a stats command?

denisevw
Path Finder

Hi Splunkers

I need some assistance with a search. I need to add the values of a Field and then use them in a stats command.

The field name is "MyField" and the values and Count are:
Requests 389
Advices 233

I need to add Requests and Advices together and then use them in a stats command as Field "MyFieldTotals"

Thanks in advance

Tags (3)
1 Solution

ankireddy007
Path Finder

HI,

You are looking for something like this:

<Your Search> |eval MyFieldTotals=Requests+Advices | <Your Search>

View solution in original post

ankireddy007
Path Finder

HI,

You are looking for something like this:

<Your Search> |eval MyFieldTotals=Requests+Advices | <Your Search>

denisevw
Path Finder

That will rename the Field name, not the Value's name.

0 Karma

ankireddy007
Path Finder

You can rename using "rename"

|rename as

0 Karma

denisevw
Path Finder

Thanks for the response! It works but now the value returns as RequestsAdvices Can I rename it?

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...