All Apps and Add-ons

Response Filter for REST API Modular Input not filtering

efullman
Path Finder

I'm using one of the public Twitter streaming APIs. I was hoping I could cause it to only index events that match a Regex in the Response Filter (as advertised), but it seems to ignore it. I tested the Regex, but I'm missing some detailed documentation that might answer my questions.

Has anyone gotten this to work? I was just searching for this - lang":"en"

I'm assuming this would reject all events that don't include this, so as a result, only English tweets would flow through to the index. Unfortunately, everything still flows through.

0 Karma

Damien_Dallimor
Ultra Champion

What is the Python Regex pattern that you are entering in your setup for the response filter parameter ? Perhaps this pattern is wrong.

0 Karma

efullman
Path Finder

Damien,

Thanks for the response. I think I understand the purpose of this function now.

It doesn't filter the events that are indexed, it filters what is indexed in each event?

So you need capture groups (...) in the REGEX, and the captures get indexed?

Or is there a way to disregard a whole event? Such as nesting the captures (...(...)...) where one of the inner captures matches to a literal like "lang:"en and when the REST API modular input can't find the literal it ejects the whole event.?

Thanks for your thoughts.

0 Karma

Damien_Dallimor
Ultra Champion

I think you are confusing yourself.

It is rather simple.

Write a REGEX. If the REGEX matches the raw response, it gets processed and sent to Splunk for indexing. Else , it gets discarded.

0 Karma

efullman
Path Finder

Just searching for the literal - lang":"en"to start. It should match at least 40% of the time.

0 Karma

Damien_Dallimor
Ultra Champion

Thats doesn't look like a Python Regex Pattern that would match an entire response.

I would suggest getting some data of an entire raw response and trying out some Regexes first.
There are some online tools for trying out Regexes such as http://pythex.org/

0 Karma
Get Updates on the Splunk Community!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...