Splunk Search

Can we put or in 2 regex conditions

aashish_122001
Explorer

Can we put or in 2 regex conditions?

If no, is there any alternative?

for example

index = idx1 | regex name = ^Aa or id = ^101

Tags (2)
0 Karma
1 Solution

mtranchita
Communicator

If I follow your question it should just be a matter of crafting your expression properly
simple example:

index = idx1 | regex name="\w|\d"

Should return results where the value of the field called name is a word or digit character

View solution in original post

0 Karma

mtranchita
Communicator

If I follow your question it should just be a matter of crafting your expression properly
simple example:

index = idx1 | regex name="\w|\d"

Should return results where the value of the field called name is a word or digit character

0 Karma

aashish_122001
Explorer

Can we use upper function also to make the regular expression search case insensitive or is there any other way ?

0 Karma

mtranchita
Communicator

Yes, you should be able to use any valid PCRE.
Splunk's documentation can explain this much better than I:
http://docs.splunk.com/Documentation/Splunk/6.3.0/Knowledge/AboutSplunkregularexpressions

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...