Security

Extract username with comma

loorimar
Engager

I have the following syslog

Jan 30 14:34:05 10.234.150.21 Jan 30 13:34:05 DEN-COLO-VBN-CTRL-01 stm[10699]: <305007> AP Smith, John replacement bootstrapped

I am trying to extract "John Smith" as the username. The closest I have gotten so far:

(?:[^-\n]*-){8}\d+\s+\d+.\d+.\d+.\d+>\s+\w+\s+(?P[^,]+),(?P\s+\w+)

which extracts "John" as the First Name and "Smith" as the last name. Can I concatenate the two somehow? Also having the username as "Smith, John" would work as well.

Any thoughts?

Brian_Osburn
Builder

You can use an eval command to create a new field:

| eval fullname= fieldname1 . " " . fieldname2

That'll create a field called fullname that's = "John Smith"

Brian

loorimar
Engager

Thanks Brian,

That's very cool. Ideally I would like to have this extracted into a single field at search time so I don't have to eval it as part of the search.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...