Splunk Enterprise

Eval Expression filter ingestion actions

vishalduttauk
Communicator

I am ingesting data from the Splunk Add on for O365. I want to use the Eval Expression filter within an ingestion action to filter what email addresses we ingest data from. Sampling the data is easy but the next bit isn't. I drop events where the RecipientAddress is not splunk.test@test.co.uk.


Creating an | eval within a search is simple but creating something that works for a filter using eval expression,  which drops Events is where i am struggling.

Our Exchange/Entra team are having problems limiting the online mailboxes the Splunk application which is why I am looking at this workaround.

Ignore the application thats tagged as we are using Enterprise 9.3.4. Can you help?

Labels (2)
0 Karma
1 Solution

PrewinThomas
Motivator

@vishalduttauk 

In a regular search, RecipientAddress is extracted at search time, so you can use it directly in eval. But in Ingest Actions, you're working with the raw event stream before field extractions happen.

But you can use this as workaround to drop events that contain this email address.

NOT match(_raw, "splunk\.test@test\.co\.uk")

 

Regards,
Prewin
Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!

View solution in original post

PickleRick
SplunkTrust
SplunkTrust

The typical issue when working in the ingest pipeline is that you don't have search-time field extracted at this point. You must work on raw event contents.

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @vishalduttauk 

Can you share the eval you created which works in the search and I can check this against Ingest Actions.

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

vishalduttauk
Communicator

I might have a solution now by using this statement:

NOT match(_raw,"splunk.test@test.co.uk")

0 Karma

vishalduttauk
Communicator
Hi @livehybrid, Here is the eval which works on the search | eval match=if(RecipientAddress="splunk.test@vwfs.co.uk",1,0) | search match=1
0 Karma

PrewinThomas
Motivator

@vishalduttauk 

In a regular search, RecipientAddress is extracted at search time, so you can use it directly in eval. But in Ingest Actions, you're working with the raw event stream before field extractions happen.

But you can use this as workaround to drop events that contain this email address.

NOT match(_raw, "splunk\.test@test\.co\.uk")

 

Regards,
Prewin
Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a Karma. Thanks!

vishalduttauk
Communicator

Thank you Prewin that has worked

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...