<?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 Re: Using Macro in savedsearches.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85274#M182113</link>
    <description>&lt;P&gt;I did some testing on this.  This answer is right.  What i did is:&lt;/P&gt;

&lt;P&gt;Add following into macro.conf:&lt;/P&gt;

&lt;P&gt;[Time_Range_To_Get_Stats_From_All]&lt;BR /&gt;
definition = -3d&lt;/P&gt;

&lt;P&gt;Add following into savedsearch.conf:&lt;/P&gt;

&lt;P&gt;dispatch.earliest_time = &lt;CODE&gt;Time_Range_To_Get_Stats_From_All&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This should be equal to put following line to savedsearch.conf file:&lt;/P&gt;

&lt;P&gt;dispatch.earliest_time = -3d&lt;/P&gt;

&lt;P&gt;But the result is not.  The scheduled saved search is running.  But not for 3 days data.  Instead, it is for all data in the system.  I got this from S.o.S.  It seems Splunk will use wrong date range if it finds the format is incorrect.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:41:48 GMT</pubDate>
    <dc:creator>tonopahtaos</dc:creator>
    <dc:date>2020-09-28T12:41:48Z</dc:date>
    <item>
      <title>Using Macro in savedsearches.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85269#M182108</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've following entry in my savedsearches.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[My_Summary_Query]
action.email.inline = 1
action.email.reportServerEnabled = 0
action.summary_index = 1
action.summary_index._name = `MY_SUMMARY_MACRO`
alert.suppress = 0
alert.track = 0
cron_schedule = 0 * * * *
dispatch.earliest_time = -1h@h
dispatch.latest_time = @h
enableSched = 1
realtime_schedule = 0
search = `MY_MACRO` sourcetype="my_log" | &amp;lt;my query here...&amp;gt; 
vsid = *:fjdfnv5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above code works fine &amp;amp; dashboard is displayed fine too. but then in Manager-&amp;gt;Searches &amp;amp; Reports, if I click on the above query, it shows &lt;CODE&gt;MY_SUMMARY_MACRO&lt;/CODE&gt; in the "Select the summary index" drop-down under "Summary Indexing" section.&lt;/P&gt;

&lt;P&gt;And it starts displaying warning above, if I save anything....&lt;/P&gt;

&lt;P&gt;Is this an issue in splunk?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:01:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85269#M182108</guid>
      <dc:creator>freephoneid</dc:creator>
      <dc:date>2011-10-03T18:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro in savedsearches.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85270#M182109</link>
      <description>&lt;P&gt;No, you can't run a macro there. The only place macros are expanded in when search strings are evaluated.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:20:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85270#M182109</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-03T18:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro in savedsearches.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85271#M182110</link>
      <description>&lt;P&gt;But there is no harm in putting these macros as shown above, right?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85271#M182110</guid>
      <dc:creator>freephoneid</dc:creator>
      <dc:date>2011-10-03T18:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro in savedsearches.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85272#M182111</link>
      <description>&lt;P&gt;there is some harm, if only in extra server resources and space being consumed. can you please explain why you have summary indexing enabled, and what you think entering a macro there will do for you?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:39:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85272#M182111</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-03T18:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro in savedsearches.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85273#M182112</link>
      <description>&lt;P&gt;The reason I added macro is because we've different environments, say alpha, &amp;amp; when I want to deploy in Alpha, I'll simply change the macro to use just different index name...My macro contains only index definition...How would there be an issue exactly, can you explain?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85273#M182112</guid>
      <dc:creator>freephoneid</dc:creator>
      <dc:date>2011-10-03T18:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Macro in savedsearches.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85274#M182113</link>
      <description>&lt;P&gt;I did some testing on this.  This answer is right.  What i did is:&lt;/P&gt;

&lt;P&gt;Add following into macro.conf:&lt;/P&gt;

&lt;P&gt;[Time_Range_To_Get_Stats_From_All]&lt;BR /&gt;
definition = -3d&lt;/P&gt;

&lt;P&gt;Add following into savedsearch.conf:&lt;/P&gt;

&lt;P&gt;dispatch.earliest_time = &lt;CODE&gt;Time_Range_To_Get_Stats_From_All&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This should be equal to put following line to savedsearch.conf file:&lt;/P&gt;

&lt;P&gt;dispatch.earliest_time = -3d&lt;/P&gt;

&lt;P&gt;But the result is not.  The scheduled saved search is running.  But not for 3 days data.  Instead, it is for all data in the system.  I got this from S.o.S.  It seems Splunk will use wrong date range if it finds the format is incorrect.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-Macro-in-savedsearches-conf/m-p/85274#M182113</guid>
      <dc:creator>tonopahtaos</dc:creator>
      <dc:date>2020-09-28T12:41:48Z</dc:date>
    </item>
  </channel>
</rss>

