<?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: saved search index in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444828#M7149</link>
    <description>&lt;P&gt;What you are describing is a macro. See here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.4/Knowledge/Usesearchmacros"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.4/Knowledge/Usesearchmacros&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You create a macro which contains the first part of your search, and then run it with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`my_macro`|search Username="Machine2" .....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Mar 2019 14:10:09 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2019-03-20T14:10:09Z</dc:date>
    <item>
      <title>saved search index</title>
      <link>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444827#M7148</link>
      <description>&lt;P&gt;is there a way that I can save a search that is common to all, so that when I ran it to make another search I wont have to include it in the search bar again? also to optimize the searching and make it faster&lt;/P&gt;

&lt;P&gt;my search goes like this:&lt;BR /&gt;
for machine 1: &lt;BR /&gt;
&lt;STRONG&gt;source="C:\Users\Administrator\Documents\PATLITE\*" host="DESKTOP-G546H69" sourcetype="csv" &lt;BR /&gt;
| rename "Green information" AS "Green" | rename "Amber information" AS "Yellow" | rename "Red information" AS "Red" | rename "User name" AS Username &lt;BR /&gt;
| fields Date_Time, Username, Green, Yellow, Red |rex field=Date_Time "(?P\d{4}\/\d{2}\/\d{2})\s(?P\d{2}:\d{2}:\d{2})" &lt;BR /&gt;
|sort -Time &lt;BR /&gt;
|table Time, Username, Green, Yellow, Red&lt;/STRONG&gt;&lt;BR /&gt;
|search Username="Machine1"&lt;BR /&gt;
|dedup Time&lt;BR /&gt;
|sort 0 Time Username Green Yellow Red&lt;BR /&gt;
|eval Time=strptime(Time, "%H:%M:%S") &lt;BR /&gt;
|streamstats window=1 current=f last(Time) as prevTime last(Green) as cGREEN last(Yellow) as cYELLOW last(Red) as cRED by Username&lt;BR /&gt;
|eval Duration=round(Time-prevTime)&lt;BR /&gt;
|eval Duration = tostring(Duration, "Duration")&lt;BR /&gt;
|eval Time=strftime(Time,"%H:%M:%S")&lt;BR /&gt;
|eval prevTime=strftime(prevTime,"%H:%M:%S")&lt;BR /&gt;
|table Duration cGREEN cYELLOW cRED&lt;/P&gt;

&lt;P&gt;for machine 2:&lt;BR /&gt;
&lt;STRONG&gt;source="C:\Users\Administrator\Documents\PATLITE\*" host="DESKTOP-G546H69" sourcetype="csv" &lt;BR /&gt;
| rename "Green information" AS "Green" | rename "Amber information" AS "Yellow" | rename "Red information" AS "Red" | rename "User name" AS Username &lt;BR /&gt;
| fields Date_Time, Username, Green, Yellow, Red |rex field=Date_Time "(?P\d{4}\/\d{2}\/\d{2})\s(?P\d{2}:\d{2}:\d{2})" &lt;BR /&gt;
|sort -Time &lt;BR /&gt;
|table Time, Username, Green, Yellow, Red&lt;/STRONG&gt;&lt;BR /&gt;
|search Username="Machine2"&lt;BR /&gt;
|dedup Time&lt;BR /&gt;
|sort 0 Time Username Green Yellow Red&lt;BR /&gt;
|eval Time=strptime(Time, "%H:%M:%S") &lt;BR /&gt;
|streamstats window=1 current=f last(Time) as prevTime last(Green) as cGREEN last(Yellow) as cYELLOW last(Red) as cRED by Username&lt;BR /&gt;
|eval Duration=round(Time-prevTime)&lt;BR /&gt;
|eval Duration = tostring(Duration, "Duration")&lt;BR /&gt;
|eval Time=strftime(Time,"%H:%M:%S")&lt;BR /&gt;
|eval prevTime=strftime(prevTime,"%H:%M:%S")&lt;BR /&gt;
|table Duration cGREEN cYELLOW cRED&lt;/P&gt;

&lt;P&gt;the ones in bold are the ones I want to save&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:44:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444827#M7148</guid>
      <dc:creator>mdmaala</dc:creator>
      <dc:date>2020-09-29T23:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: saved search index</title>
      <link>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444828#M7149</link>
      <description>&lt;P&gt;What you are describing is a macro. See here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.4/Knowledge/Usesearchmacros"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.4/Knowledge/Usesearchmacros&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You create a macro which contains the first part of your search, and then run it with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`my_macro`|search Username="Machine2" .....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 14:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444828#M7149</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-20T14:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: saved search index</title>
      <link>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444829#M7150</link>
      <description>&lt;P&gt;thank you so much i'll try this!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 01:37:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/saved-search-index/m-p/444829#M7150</guid>
      <dc:creator>mdmaala</dc:creator>
      <dc:date>2019-03-21T01:37:27Z</dc:date>
    </item>
  </channel>
</rss>

