<?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 Save SPL commands into one SPL new command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470520#M192154</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Is it possible to save SPL command into one new command and use it when running a query?&lt;/P&gt;

&lt;P&gt;For example:&lt;BR /&gt;
| dedup 1 id | stats count by hostname  ----&amp;gt; my_command&lt;/P&gt;

&lt;P&gt;When running a query, I want to use it as:&lt;BR /&gt;
 | my_command&lt;/P&gt;

&lt;P&gt;How can I do that?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 08:32:55 GMT</pubDate>
    <dc:creator>shayhibah</dc:creator>
    <dc:date>2019-09-03T08:32:55Z</dc:date>
    <item>
      <title>Save SPL commands into one SPL new command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470520#M192154</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Is it possible to save SPL command into one new command and use it when running a query?&lt;/P&gt;

&lt;P&gt;For example:&lt;BR /&gt;
| dedup 1 id | stats count by hostname  ----&amp;gt; my_command&lt;/P&gt;

&lt;P&gt;When running a query, I want to use it as:&lt;BR /&gt;
 | my_command&lt;/P&gt;

&lt;P&gt;How can I do that?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 08:32:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470520#M192154</guid>
      <dc:creator>shayhibah</dc:creator>
      <dc:date>2019-09-03T08:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Save SPL commands into one SPL new command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470521#M192155</link>
      <description>&lt;P&gt;If you saved this as MySavedSearch&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dedup 1 id | stats count by hostname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| savedsearch MySavedSearch
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, if you schedule MySavedSearch, you could also use loadjob to load the results of the previous run (instead of re-running it ad-hoc).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 08:45:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470521#M192155</guid>
      <dc:creator>broberg</dc:creator>
      <dc:date>2019-09-03T08:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Save SPL commands into one SPL new command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470522#M192156</link>
      <description>&lt;P&gt;you can use Search macros.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Usesearchmacros"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.1/Knowledge/Usesearchmacros&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 09:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Save-SPL-commands-into-one-SPL-new-command/m-p/470522#M192156</guid>
      <dc:creator>thomasroulet</dc:creator>
      <dc:date>2019-09-03T09:55:45Z</dc:date>
    </item>
  </channel>
</rss>

