Splunk Search

parsing _internal logs

JohnEGones
Path Finder

Hi Fellow Splunkers,

Have a hopefully quick question:

Want to pull out the source and host from the Windows _internal splunk logs, but my rex (cribbed from a post on here) isn't working.

 

index=_internal host IN (spfrd1, spfrd2) source="*\\Splunk\\var\\log\\splunk\\splunkd.log" component=DateParserVerbose 
| rex "Context: source=(?P<sourcetypeissue>\w+)\Shost=(?P<sourcehost>\w+)" 
| stats list(sourcetypeissue) as file_name list(sourcehost)

 

But I get no stats, my events look like this:

 

08-24-2022 07:50:20.383 -0400 WARN  DateParserVerbose - Failed to parse timestamp in first MAX_TIMESTAMP_LOOKAHEAD (128) characters of event. Defaulting to timestamp of previous event (Sun Aug 24 07:49:58 2022). Context: source::WMI:WinEventLog:Security|host::SPFRD1|WMI:WinEventLog:Security|1

 

 

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try it like this

| rex "Context: source::(?P<sourcetypeissue>\w+)\Shost::(?P<sourcehost>\w+)"

View solution in original post

0 Karma

JohnEGones
Path Finder

ITWhisperer,

Yeah that doesn't work but now I realize its because there is a file path reference:

source::X:\logs\[some IP]\log123.txt|host::[host]

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try it like this

| rex "Context: source::(?P<sourcetypeissue>\w+)\Shost::(?P<sourcehost>\w+)"
0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...