Splunk Search

How to assign numeric values based on counts?

yagbootz48
New Member

Hello,

I need some help. I'm trying to make a search where I take recipient_count and assign a "value" based on how many recipients there are. For example, recipient_count greater than or equal to 25 value=5, recipient_count range is between 50-99 value=7, recipient_count greater than or equal to 100 value=9

Any ideas how I could accomplish this?

Thanks in advance!

0 Karma
1 Solution

thambisetty
SplunkTrust
SplunkTrust

try something like below,

| your base search
| eval value=case(recipient_count>=25 AND recipient_count<=50 ,5,recipient_count>50 AND recipient_count<=99,7,recipient_count>=100,9)
————————————
If this helps, give a like below.

View solution in original post

yagbootz48
New Member

@thambisetty thanks!

0 Karma

woodcock
Esteemed Legend
0 Karma

thambisetty
SplunkTrust
SplunkTrust

try something like below,

| your base search
| eval value=case(recipient_count>=25 AND recipient_count<=50 ,5,recipient_count>50 AND recipient_count<=99,7,recipient_count>=100,9)
————————————
If this helps, give a like below.
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...