Splunk Search

OR contition simulation between two search query

karakutu
Path Finder

since one of the username need to be simulate with regex query . I am forced to use regex

how can I do it so that I simulate kind of OR condition between main and sub search query

index=main
suser IN("abc","def")
| search  regex suser =”DEF[0-9]"
AND EventID IN("323","322")
 
Thanks
 
 
 
Labels (1)
Tags (1)
1 Solution

inventsekar
SplunkTrust
SplunkTrust

index=main suser IN("abc","def") [search regex suser =”DEF[0-9]" AND EventID IN("323","322") | fields suser] | table suser field1 field2

i am little confused about this OR requirement and i am little confused on the regex inside subsearch as well. maybe if you give us some sample logs, the subsearch may not be needed altogether. h

 

(i received 100 karma points giver badge, have you?!?!)

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !

View solution in original post

karakutu
Path Finder

thanks for your support. sample log I can not give.

 

the problem is I have a special username which need to be simulate with regex.

since I can not user regex into IN function.   so I just want to simulate it separately. 

maybe I use unnecessary function. maybe we can do it much easier. I am not sure.

 

 

inventsekar
SplunkTrust
SplunkTrust

no need to write us the full logs. you can hide/edit the hostnames/confidential info in the logs and update us the sample log. 

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma

inventsekar
SplunkTrust
SplunkTrust

index=main suser IN("abc","def") [search regex suser =”DEF[0-9]" AND EventID IN("323","322") | fields suser] | table suser field1 field2

i am little confused about this OR requirement and i am little confused on the regex inside subsearch as well. maybe if you give us some sample logs, the subsearch may not be needed altogether. h

 

(i received 100 karma points giver badge, have you?!?!)

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...