Splunk Search

REGEX issue with multiple criteria

Scarecrowddb
Explorer

Hi All,

I'm trying to filter our file audit logs, however I would like for it to ignore any files ending in .tmp

I can't seem to get the below to work properly... it seems to match on the event code and the Accesses but completely miss the Object Name for some reason?

REGEX = (?msi)EventCode=(4663|567|560).Object Name:\s(?!.tmp).Accesses:\s(DELETE|WRITE_DAC|WriteData)

An example log is:

20110309155132.000000
Category=3
CategoryString=Object Access
ComputerName=ComputerName
EventCode=560
EventIdentifier=560
EventType=4
Logfile=Security
RecordNumber=2572431
SourceName=Security
TimeGenerated=20110309155132.000000+600
TimeWritten=20110309155132.000000+600
Type=Audit Success
User=Username
wmi_type=WinEventLog:Security
Message=Object Open:

Object Server:  Security

Object Type:    File

Object Name:    G:\users\xxxxxx\Outlook .pst folders\~archive.pst.tmp

Handle ID:  7420

Operation ID:   {0,239001151}

Process ID: 4

Image File Name:    

Primary User Name:  SERVER$

Primary Domain: XXX

Primary Logon ID:   (0x0,0x3E7)

Client User Name:   User

Client Domain:  Domain

Client Logon ID:    (0x0,0xBA49FA7)

Accesses:   DELETE 
        ReadAttributes 


Privileges: -

Restricted Sid Count:   0

Access Mask:    0x10080

Any idea's as to where I'm going wrong would be appreciated....

Thanks,

DB

0 Karma

wollinet
Path Finder

Try this one:

REGEX = (?msi)EventCode=(4663|567|560).Object Name:\s(?<!\.tmp).Accesses:\s(DELETE|WRITE_DAC|WriteData)

But I wonder if simply using "." to match over several lines really works. You can also try something like this:

REGEX = (?mi)^EventCode=(4663|567|560).*^Object Name:.*\.tmp$.*^Accesses:\s(DELETE|WRITE_DAC|WriteData)
0 Karma

wollinet
Path Finder

Just tried something like this and it seems to work:

(?msi)^EventCode=(540|567|560).Object Name:..tmp.*Accesses:\s(DELETE|WRITE_DAC|WriteData)

I couldn't try your exact pattern, but used a similar expression.

0 Karma

Scarecrowddb
Explorer

Any other idea's??

0 Karma

Scarecrowddb
Explorer

Hi There... sorry, but neither of the above works....

Any other suggestions?

0 Karma

Scarecrowddb
Explorer

Hi there, I've posted an example log above now.... thanks!

0 Karma

wollinet
Path Finder

Can you post some sample log records ?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...