Getting Data In

sedcmd with Eventlog

akuzma_2
New Member

I want to remove lot of rows in windows eventlog.

I tested it on EventCode=4624 - successful login

02/01/2018 09:56:03 AM
LogName=Security
SourceName=Microsoft Windows security auditing.
EventCode=4624
EventType=0
Type=Information
ComputerName=COMPUTER1
TaskCategory=Logon
OpCode=Info
RecordNumber=1072237543
Keywords=Audit Success ...

but I cannot get it working. I want to use SEDCMD, but before that I tried in search with rex command in sed mode, but something like that:

rex mode=sed "s/(?!Type=\w+).+//g"

got me only one letter "T" as below:

T

What I am doing wrong?

Maybe I should use transforms instead?

0 Karma

FrankVl
Ultra Champion

What exactly is your goal? Which part of the message do you want to remove?

Looking at regex101 with your data and regex, it indeed matches everything except that single T: https://regex101.com/r/BoyXLF/1

Looks like your way of using that negative lookahead is incorrect for what you want to accomplish.

0 Karma

akuzma_2
New Member

I found that it's incorrect, but I does not know how to make it right.

My goal is to remove almost all fields and leave only 3-4 I need.

0 Karma

FrankVl
Ultra Champion

If you tell us which fields you want to remove and which you want to keep, we can help you, but if we don't know what exactly you want to remove, it is impossible to suggest another regex.

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...