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
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...