Splunk Search

Account status -> bypassed, is it enabled?

jbanAtSplunk
Communicator

Hi,

We have status in one log type, where we would like to track if account is in state: bypassed

Example:

2021-13-10 user1 bypassed

2021-13-10 user2 enabled

2021-13-09 user2 bypassed
2021-13-08 user3 bypassed

2021-13-08 user3 active
2021-13-08 user3 bypassed
2021-13-07 user3 active

how can we find last 2 status for user in period of time and than based on last bypass/active status we get only accounts that have still active bypass status?

 

Labels (3)
0 Karma
1 Solution

jbanAtSplunk
Communicator

Hey,

I think I solve this with this query using eventstats dc (this is giving me last two condition) where I can then see if the last status is Bypass.
example:

index=<index> sourcetype=<sourcetype> ( status="Enabled" OR status="Bypass") | eventstats dc(status) as state by user |  sort - _time user | eventstats latest(status) AS condition by user |  where condition=Bypass | ... playing with time condition

 

View solution in original post

Tags (2)

richgalloway
SplunkTrust
SplunkTrust

To get the last 2 statuses for a user, use dedup 2.

... | dedup 2 user
...

To get the current status, use dedup.

... | dedup user
| where status="bypassed"
---
If this reply helps you, Karma would be appreciated.
0 Karma

jbanAtSplunk
Communicator

Hey,

I think I solve this with this query using eventstats dc (this is giving me last two condition) where I can then see if the last status is Bypass.
example:

index=<index> sourcetype=<sourcetype> ( status="Enabled" OR status="Bypass") | eventstats dc(status) as state by user |  sort - _time user | eventstats latest(status) AS condition by user |  where condition=Bypass | ... playing with time condition

 

Tags (2)
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...