Splunk Search

Regex for filed extraction

darshan_singh01
Path Finder

Feb 13 22:01:25 XXXINFQST03 sshd[9161]: Accepted password for admin from

Above is the message I am getting from Linux logs from which I want to create fileds like

Time:Feb 13 22:01:25 & User=admin

Can anyone provide me the regex for this or any other way ??

Help apprecieted ..

Tags (3)
0 Karma

dshpritz
SplunkTrust
SplunkTrust

If your sourcetype is syslog, and you have Splunk_TA_nix installed, you should get the user information that you want. If you really want it all in one field, you could try this in your props.conf:

[mysourcetype]
REPORT-myfield = myfield

Then in your transforms.conf

[myfield]
REGEX = (\w{3}\s+\d+\s+\d{2}:\d{2}:\d{2}).*Accepted\spassword\sfor\s(\S+)
FORMAT = myfield::Time:$1 & User=$2

Not positive about the spaces in the FORMAT section, but it's a start.

HTH

Dave

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!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...