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!

The Payment Operations Wake-Up Call: Why Financial Institutions Can't Afford ...

The same scenario plays out across financial institutions daily. A payment system fails at 11:30 AM on a busy ...

Make Your Case: A Ready-to-Send Letter for Getting Approval to Attend .conf25

Hello Splunkers, Want to attend .conf25 in Boston this year but not sure how to convince your manager? We've ...

Community Spotlight: A Splunk Expert's Journey

In the world of data analytics, some journeys leave a lasting impact not only on the individual but on the ...