<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Number of scheduled searches and ad-hoc searches per day in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80831#M16671</link>
    <description>&lt;P&gt;I would like to get a total count of the number of scheduled searches and ad-hoc (UI based) searches that are run per day.&lt;/P&gt;

&lt;P&gt;In pre-5.x Splunk I could use:&lt;/P&gt;

&lt;P&gt;index=_internal (sourcetype=searches OR sourcetype=scheduler) | timechart span="1d" count(host) by sourcetype&lt;/P&gt;

&lt;P&gt;Apparently the sourcetype=searches no longer returns results.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2013 12:45:54 GMT</pubDate>
    <dc:creator>rmorlen</dc:creator>
    <dc:date>2013-07-01T12:45:54Z</dc:date>
    <item>
      <title>Number of scheduled searches and ad-hoc searches per day</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80831#M16671</link>
      <description>&lt;P&gt;I would like to get a total count of the number of scheduled searches and ad-hoc (UI based) searches that are run per day.&lt;/P&gt;

&lt;P&gt;In pre-5.x Splunk I could use:&lt;/P&gt;

&lt;P&gt;index=_internal (sourcetype=searches OR sourcetype=scheduler) | timechart span="1d" count(host) by sourcetype&lt;/P&gt;

&lt;P&gt;Apparently the sourcetype=searches no longer returns results.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2013 12:45:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80831#M16671</guid>
      <dc:creator>rmorlen</dc:creator>
      <dc:date>2013-07-01T12:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Number of scheduled searches and ad-hoc searches per day</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80832#M16672</link>
      <description>&lt;P&gt;Also tried this but the numbers don't look right:&lt;/P&gt;

&lt;P&gt;index=_audit user!=splunk-system-user | stats count by action&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2013 13:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80832#M16672</guid>
      <dc:creator>rmorlen</dc:creator>
      <dc:date>2013-07-01T13:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Number of scheduled searches and ad-hoc searches per day</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80833#M16673</link>
      <description>&lt;P&gt;Number of scheduled searches per day:&lt;/P&gt;

&lt;P&gt;index=_internal sourcetype="scheduler" | timechart span=1d count(savedsearch_name) by host | addtotals&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2014 18:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80833#M16673</guid>
      <dc:creator>rmorlen</dc:creator>
      <dc:date>2014-01-14T18:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Number of scheduled searches and ad-hoc searches per day</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80834#M16674</link>
      <description>&lt;P&gt;If you are collecting process-level information for Splunk processes using the &lt;A href="http://www.splunk.com/goto/sos"&gt;S.o.S app&lt;/A&gt;'s &lt;CODE&gt;ps_sos.sh&lt;/CODE&gt; scripted input, you can break down your daily search workload between scheduled and ad-hoc searches like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`set_sos_index` sourcetype=ps host=&amp;lt;indexer or search-head host&amp;gt;
| multikv
| `get_splunk_process_type`
| search type="searches"
| rex field=ARGS "_--user=(?&amp;lt;search_user&amp;gt;.*?)_--"
| rex field=ARGS "--id=(?&amp;lt;sid&amp;gt;.*?)_--"
| rex field=sid "remote_(?&amp;lt;search_head&amp;gt;[^_]*?)_"
| eval is_remote=if(like(sid,"%remote%"),"remote","local")
| eval is_scheduled=if(like(sid,"%scheduler_%"),"scheduled","ad-hoc")
| eval is_realtime=if(like(sid,"%rt_%"),"real-time","historical")
| eval is_subsearch=if(like(sid,"%subsearch_%"),"subsearch","generic")
| eval search_type=is_remote.", ".is_scheduled.", ".is_realtime
| timechart span=1d dc(sid) AS "Search count" by is_scheduled
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that you'l need to run this search from within the context of the S.o.S app for the macros it uses to be available. You will also need for the &lt;CODE&gt;ps_sos.sh&lt;/CODE&gt; scripted input to have been running for several days on the instance that you are targeting the search against.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2014 02:16:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Number-of-scheduled-searches-and-ad-hoc-searches-per-day/m-p/80834#M16674</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2014-02-05T02:16:37Z</dc:date>
    </item>
  </channel>
</rss>

