Splunk Search

Can someone help me with a regex that transforms nullQueue before specific date?

anzianojackson6
Explorer

I've got data coming in (Dropbox). This is pulled with the TA via REST API. I can't use the ignoreOlderThan in inputs.conf, because it's pulled via script. It wants to pull all our data since 2016 and work up to present day. Really don't care for old stuff like that.

So, I'm doing the Transforms nullQueue and props.conf method. I'm trying to exclude/ignore anything older than 2018-08 and newer. Anyone know the regex to do this?

LOG:
{"country": "US", "region": "Utah", "user_id": 000000000, "name": "Slab Squattrust", "time": "2016-10-12T16:55:49+00:00",....
{"country": "US", "region": "Utah", "user_id": 000000002, "name": "Cary Petterborg", "time": "2018-08-12T16:55:49+00:00",....
{"country": "US", "region": "Idaho", "user_id": 000000000, "name": "Flint Ironstag", "time": "2018-09-02T16:55:49+00:00",....
{"country": "US", "region": "Maryland", "user_id": 000000000, "name": "Blast Hardcheese", "time": "2018-09-01T16:55:49+00:00",....
{"country": "US", "region": "Space", "user_id": 000000000, "name": "Gristle McThornbody", "time": "2018-07-12T16:55:49+00:00",....

props.conf
[dfb:rest]
TRANSFORMS-null=setnull

transforms.conf
[setnull]
REGEX =
DEST_KEY = queue
FORMAT = nullQueue

Also, bonus Karma points if you can guess the movie reference. And a possibly awkward hug at .conf next month from me.

0 Karma

sudosplunk
Motivator

If you're timestamp is this "time": "YYYY-MM always, then try something like below:

transforms.conf

[setnull]
REGEX = time\"\:\s\"(201[0-7]|2018\-0[0-7])
DEST_KEY = queue
FORMAT = nullQueue
0 Karma

kristian_kolb
Ultra Champion
REGEX = time\"\:\s\"(201[0-7]|2018\-0[0-7])

if you want to have the exclude anything before August 2018.

mstjohn_splunk
Splunk Employee
Splunk Employee

haha @anzianojackson6761, I was just searching your usernames to see what those were a reference to. Looks like I need to see Space Muntiny 🙂

0 Karma

anzianojackson6
Explorer

Nice. You win.

Back to the ticket, I'm wondering if I do something like:
REGEX = 201[0-7].*
DEST_KEY = queue
FORMAT = nullQueue

I'd accomplish the same thing.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...