Splunk Search

Field Extraction

carmackd
Communicator

I have a log file that looks like this:

Wed Aug 11 14:27:48 GMT 2010 | Inactive Users Last 7 Days---> | 123456789 | 321654987 | 489756123 | 111000555

Wed Aug 12 14:20:18 GMT 2010 | Inactive Users Last 7 Days---> | 123456789 | 321654987 | 489756123 | 111000555 | 222211145 | 789789741

Basically I want to extract this into three fields, timestamp, range, and userID. Currently I'm using a transform with a "|" deliminator. The problem is, this is only getting the first userID, not the ones that follow. keep in mind, each event can have different amounts of userID's. For example, the first event has 4 userID's, and the second has 6 userID's, another could have 20. I want to extract them all into a single field.

Tags (1)
0 Karma

twinspop
Influencer

rex with max_match?

| rex field=_raw "\|(?<users>[0-9]+)" max_match=100

That should result in a users multi-valued field. (With a max of 100 users contained therein.)

hbazan
Path Finder

I almost got it:

| rex field=raw "Inactive Users Last 7 Days--->(?<users>.*)" | eval user=split(users," | ") | top user

But, there's a empty user value. Get rid of that and you're done.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...