Splunk Search

How can I identify real time searches?

ddrillic
Ultra Champion

We suspect that some of our users run real time searches. How can I produce a report which shows real time search activity in the past week, month or so?

Tags (1)
0 Karma
1 Solution

mayurr98
Super Champion

hey @ddrillic

try this

| rest /services/search/jobs | search eventSorting=realtime

I hope that helps you!

View solution in original post

cmerriman
Super Champion

use |rest /services/search/jobs|search isRealTimeSearch=1 to see if that gets you what you need.
http://docs.splunk.com/Documentation/Splunk/4.3.6/RESTAPI/RESTsearch#GET_search.2Fjobs documentation to know what fields you might want

splunkreal
Motivator

|rest /services/search/jobs|search isRealTimeSearch=1 

works however it doesn't seem to work on expired jobs.

* If this helps, please upvote or accept solution if it solved *
0 Karma

Dallastek1
Path Finder

try this:

index=_audit action=search is_realtime=1
| eval search_type=case(
search_id LIKE "scheduler%", "Scheduled Search",
search_id LIKE "rt_scheduler%", "Real-Time Scheduled Search",
search_id LIKE "dashboard%", "Dashboard",
search_id LIKE "adhoc%", "Ad-hoc Search",
1=1, "Ad-hoc Search"
)
| eval human_readable_time = strftime(_time, "%Y-%m-%d %H:%M:%S")
| stats count by user, search_type, _time
| rename human_readable_time AS "Time", user AS "User", search_type AS "Search Type", count AS "Search Count"
| sort - "Time"
0 Karma

nickhills
Ultra Champion

I have this running as an alert to let me know who is running rt searches, and how long for

| rest /services/search/jobs | search eventSorting=realtime | table label, author, dispatchState,  eai:acl.owner, label, isRealTimeSearch, performance.dispatch.stream.local.duration_secs, runDuration, searchProviders, splunk_server, title
If my comment helps, please give it a thumbs up!

adobrzeniecki
Path Finder

According to the documentation below, there is not an option for eventSorting=realtime.
Indicates if the events of this search are sorted, and in which order.
asc = ascending;

desc = descending;

none = not sorted

Would the actual setting to be used be isRealTimeSearch?

0 Karma

mayurr98
Super Champion

hey @ddrillic

try this

| rest /services/search/jobs | search eventSorting=realtime

I hope that helps you!

pnodine1
Engager

You can get cleaner results by adding a table.

|rest /services/search/jobs 
| search eventSorting=realtime 
| table label, author, dispatchState,  eai:acl.owner, label, isRealTimeSearch, 
  performance.dispatch.stream.local.duration_secs, runDuration, 
  splunk_server, title
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 ...