Splunk Search

Number of unique days a given IP address was used

LeBarcode
Engager

Hey All, 

This may be something very basic, but I can't seem to find exactly what I'm looking to do on the forums.

For context, I'm trying to look at device details users have during their actions within an application. Things like IP Addresses, and User Agents. I was hoping to break down the number of unique days an IP address (or similar detail) was used. Using a very basic chart search I can get these numbers:

 

index=x sourcetype=x [userID that would be passed via subquery]| chart count by _time span=1d ipAddress

 

_time1.1.1.12.2.2.2
2020-10-1510
2020-10-1500
2020-10-1510
2020-10-1500
2020-10-1539
2020-10-1520

 

and I would like to convert this into something like:

1.1.1.1 = 4 unique days 

2.2.2.2 = 1 unique day

The idea being that the userID was passed to this outer query because of some other criteria indicative of a possible compromise (such as a certain sequence of events on that profile, or a known IOC), then this search would determine if there was an outlier IP address that was used during the most recent event. (being able to filter out any events that occurred from an IP/useragent that has already been used for >X unique days)

Open to any suggestions, just kind of tinkering around

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
index=x sourcetype=x [userID that would be passed via subquery]
| bin span=1d _time
| stats count by _time ipAddress
| chart count by ipAddress

View solution in original post

LeBarcode
Engager

Thank you very much, exactly what I was looking to do!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=x sourcetype=x [userID that would be passed via subquery]
| bin span=1d _time
| stats count by _time ipAddress
| chart count by ipAddress
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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