Splunk Search

Splunk Query Help!

kc_prane
Communicator

I Have  Service_names  (A, B ,C ,D, E,  F, G, H, I J, K, L , M)  but want  (C ,D, E,  F, G, H, I J, K, L , M ) services_names renamed as "Other_Services"  | Stats by  services_names  | table services_names  time_Taken

Thanks in advance!

Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @kc_prane ,

you shared only a part of your search, so I cannot check it.

anyway, does it solves your requirement?

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @kc_prane ,

ony one question: what's time_Token?

if it's a field, please try something like this:

<your_search
| eval services_names=if(services_names IN ("A", "B"), service_name, "Other_Services")
| stats values(time_Token) AS time_Token BY  services_names
| table services_names  time_Taken

 otherwise, please explain what's time_Token, or apply my approach to your search.

Ciao.

Giuseppe

0 Karma

kc_prane
Communicator

Hi gcusello, Thanks for the reply,  Iam looking to get results like below.

my base search

| rex "^[^=\n]*=(?P<ServiceName>[^,]+)"
| rex "TimeMS\s\=\s(?<Trans_Time>\d+)"

Results

ServiceName         Trans_Time Count
A 60 1111
B 40 1234
Other_Services( C , D, E, F,G,H) 25 1234567
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @kc_prane ,

you shared only a part of your search, so I cannot check it.

anyway, does it solves your requirement?

Ciao.

Giuseppe

kc_prane
Communicator

Thanks for the help! @gcusello. I fixed my rex Iam seeing results now.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...