Splunk Search

search time extraction on specific index

dgnatowski
New Member

I have 2 data inputs going to 2 separate indexes.  I have 2 different REGEX expressions to obtain IPAddress and Hostname.  How can I make it so only regex#1 is executed for index#1 and regex#2 is executed for index#2?  I have used EXTRACT and REPORT entries in props.conf to perform search-time field extractions, but both regex expressions get executed and I get erroneous data for IPAddress and Hostname fields.

What's the best way to handle this situation?

Sample data from data input #1:

Feb 1 14:15:17 10.106.198.22 1 2021-02-01T19:07:01.490Z w2k19_02.xxxBD.local

Sample data from data input #2:

Feb 1 14:46:43 10.106.5.72 Feb 1 19:53:23 vCM_01.xxxbd.local appliance: <134>1 2021-02-01T19:53:18.318369Z vCM_01.xxxbd.local

 

Labels (2)
0 Karma

tscroggins
Influencer

@dgnatowski 

Ensure you have properly defined hosts, sources, or source types for each event. After that, define your field extractions for the correct host, source, or source type. The index containing the event isn't normally relevant.

In your case, input #1 and input #2 have different formats and should be defined as different source type. If you're using a common source type, e.g. syslog, then define your extractions based on host or source.

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...