<?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: How to store 1st search result in a token/variable and plug in token in other searches? (instead of running macro for each search) in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186175#M11520</link>
    <description>&lt;P&gt;I think a better solution may be to use "post-process searches" in your dashboard. Generally, the panels in a dashboard display various views of a common set of data. Figure out the base search that can drive all (or most) of the panels - which should include the macro  - and then post-process the base search results for each panel.&lt;/P&gt;

&lt;P&gt;This may give you even more efficiency than you expected!&lt;/P&gt;

&lt;P&gt;Here is a link to the docs on &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Viz/Savedsearches#Post-process_searches"&gt;Post-process searches&lt;/A&gt;.  You can also search for "Splunk postprocess search dashboard" and you will find a number of links to questions on &lt;A href="http://answers.splunk.com"&gt;Answers&lt;/A&gt; as well.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2015 21:18:32 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2015-07-03T21:18:32Z</dc:date>
    <item>
      <title>How to store 1st search result in a token/variable and plug in token in other searches? (instead of running macro for each search)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186174#M11519</link>
      <description>&lt;P&gt;I am making a dashboard that takes in a network ID and outputs information about that user. &lt;/P&gt;

&lt;P&gt;Many of the searches require finding the main IP address of the user. I have a macro to output the IP from an inputted Network ID. &lt;BR /&gt;
The problem is the macro can take some time to finish, so it adds on to the speed of finding search results. And if you compound that onto a lot of panels (10+) finding all results can be slowed heavily, especially since I'm looking to add more panels.&lt;/P&gt;

&lt;P&gt;Is there a way to just do the macro once and set the result to a token/variable and just plug that variable into the panel searches rather than plugging in the macro and running the macro for each search?&lt;/P&gt;

&lt;P&gt;User inputs network ID -&amp;gt; macro runs on that net ID and stores IP in a variable -&amp;gt; plug in variable in different searches&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 16:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186174#M11519</guid>
      <dc:creator>kkas</dc:creator>
      <dc:date>2015-07-01T16:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to store 1st search result in a token/variable and plug in token in other searches? (instead of running macro for each search)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186175#M11520</link>
      <description>&lt;P&gt;I think a better solution may be to use "post-process searches" in your dashboard. Generally, the panels in a dashboard display various views of a common set of data. Figure out the base search that can drive all (or most) of the panels - which should include the macro  - and then post-process the base search results for each panel.&lt;/P&gt;

&lt;P&gt;This may give you even more efficiency than you expected!&lt;/P&gt;

&lt;P&gt;Here is a link to the docs on &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Viz/Savedsearches#Post-process_searches"&gt;Post-process searches&lt;/A&gt;.  You can also search for "Splunk postprocess search dashboard" and you will find a number of links to questions on &lt;A href="http://answers.splunk.com"&gt;Answers&lt;/A&gt; as well.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2015 21:18:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186175#M11520</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-07-03T21:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to store 1st search result in a token/variable and plug in token in other searches? (instead of running macro for each search)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186176#M11521</link>
      <description>&lt;P&gt;Ok I came back because I found a funny way to do what I was looking for a little better. &lt;BR /&gt;
I was able to use the dropdown and multisearching tool to store results. I used the autopopulate tool that allows you to input a search and populate the dropdown variables with the search results. You can then use that multisearch/dropdown's token anywhere in the code unlike post processing where it requires the search to be front end based.&lt;BR /&gt;
The multiselect tool was coded as follows for future reference&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" searchWhenChanged="true" token="comp"&amp;gt;
      &amp;lt;label&amp;gt;Select ComputerName's to Assess&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;All&amp;lt;/default&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;sourcetype="Alpha" Account_Name=$netID$ earliest=$field1.earliest$ latest=$field1.latest$|stats count(ComputerName) by ComputerName&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;valuePrefix&amp;gt;ComputerName=&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;ComputerName&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;ComputerName&amp;lt;/fieldForValue&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2015 14:18:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186176#M11521</guid>
      <dc:creator>kkas</dc:creator>
      <dc:date>2015-07-10T14:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to store 1st search result in a token/variable and plug in token in other searches? (instead of running macro for each search)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186177#M11522</link>
      <description>&lt;P&gt;Very nice solution kkas. Simple and non-intrusive. &lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 13:55:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186177#M11522</guid>
      <dc:creator>arorajagmeet</dc:creator>
      <dc:date>2016-05-18T13:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to store 1st search result in a token/variable and plug in token in other searches? (instead of running macro for each search)</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186178#M11523</link>
      <description>&lt;P&gt;I tried to duplicate this but the multi select search never finishes for me it just spins &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I ran the search in the main splunk search and it returns results just fine. Help?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 16:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-store-1st-search-result-in-a-token-variable-and-plug-in/m-p/186178#M11523</guid>
      <dc:creator>daishih</dc:creator>
      <dc:date>2016-08-10T16:05:36Z</dc:date>
    </item>
  </channel>
</rss>

