Alerting

How can I add the "act*" and "target*" fields to this table with "Host" being the primary field?

Earenhart
Path Finder

Hello everyone,

This search is designed to alert on potential password spraying attempts on servers in my environment. I have this search working when I leave out "| appendpipe [table act* target*]", but I am trying to figure out how to add those fields to the results while keeping my created "Server" field intact. Any ideas are greatly appreciated.

index=wineventlog sourcetype=WinEventLog:Security EventCode=4625 
| eval event=_raw
| rex mode=sed field=event "s/[\n\r]//g"
| rex field=event "Subject:.*Security ID:\t*(?.*?)\tAccount Name:(?.*?)\t*Account Domain:\t*(?.*?)Logon ID:\t*(?.*?)Logon Type"
| rex field=event "Account For Which Logon Failed:\tSecurity ID:\t*(?.*?)\tAccount Name:(?.*?)\t*Account Domain:\t*(?.*?)Failure Information" 
| bin _time span=1m 
| stats dc(user) as EvtCounts by src 
| rename src as server
| where EvtCounts >50
| eval Server = server." (".EvtCounts.")"
| table Server
| appendpipe [table act* target*]
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The only fields available at the end of your query are 'server' and 'EvtCounts. That's because thestatscommand filters out all fields except those explicitly mentioned. You should be able to avoid that by usingstreamstats`. Like this:

| streamstats dc(user) as EvtCounts by src 
| rename src as server
| where EvtCounts >50
| eval Server = server." (".EvtCounts.")"
| table Server act target*
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The only fields available at the end of your query are 'server' and 'EvtCounts. That's because thestatscommand filters out all fields except those explicitly mentioned. You should be able to avoid that by usingstreamstats`. Like this:

| streamstats dc(user) as EvtCounts by src 
| rename src as server
| where EvtCounts >50
| eval Server = server." (".EvtCounts.")"
| table Server act target*
---
If this reply helps you, Karma would be appreciated.
0 Karma

Earenhart
Path Finder

Thank you very much Rich! Using streamstats did the trick.

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...