Splunk Search

unable to filter specific source with REX

cleelakrishna
Loves-to-Learn

i have data coming from different sources (catalina,sailpoint,accesslogs,etc) now i want to filter it into different source types , can you please help to filter the data using "rex" .
the below query retrieves all the sources even after extracting specific source.

index=sailpoint | rex field=source "\/srv\/tomcat7\/iiq\/logs\/(?.*)"

help will be appreciated

Tags (1)
0 Karma

niketn
Legend

Can you upload your search SPL query with 101010 button so that it does not get escaped? If you can add full path of various sources (mask server names if you have to), that would also be helpful. Based on the details provided there could be multiple ways of finding various sources.
1) Rex (If you can give examples of path we can help you with this)
2) Interactive Field Extraction (IFX) : You can try out Field Extraction from the Search and extract required source names and Splunk will write its own regular expression. This will also persist as Extracted Fields knowledge object.
3) Split command to split path by slash. This will be useful if you know that required source name is at certain specific folder depth then you can combine split with mvindex to get your source names.
4) use match condition to find source names. Following is run-anywhere example for the same based on information provided:

| makeresults
| eval source="\/srv\/tomcat7\/iiq\/logs\/catalina"
| eval sourceName=case(match(source,"catalina"),"catalina",match(source,"sailpoint"),"sailpoint",match(source,"accesslogs"),"accesslogs",true(),"Unmatched")
| table source sourceName
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...