<?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: Trying to use &amp;quot;map&amp;quot; command in post process dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345185#M41809</link>
    <description>&lt;P&gt;Yes, it will definitely be slow. I strongly urge you to change your approach to direct subsearch that I offered in the XML code sample above! &lt;/P&gt;</description>
    <pubDate>Mon, 16 Apr 2018 16:46:57 GMT</pubDate>
    <dc:creator>elliotproebstel</dc:creator>
    <dc:date>2018-04-16T16:46:57Z</dc:date>
    <item>
      <title>Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345181#M41805</link>
      <description>&lt;P&gt;I have a base search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search id="Extra"&amp;gt;
      &amp;lt;query&amp;gt;index=reports | stats count by reportname&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$time1.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$time1.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&amp;lt;panel&amp;gt;
  &amp;lt;title&amp;gt;Offer's&amp;lt;/title&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;search base="Extra"&amp;gt;
      &amp;lt;query&amp;gt; |map search="search index=offered   reportname=$reportname$ |table Offer" maxsearches=0 | dedup Offer &amp;lt;/query&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
    &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the problems is the second search is not giving results.its displaying as "waiting for input" and when I click the magnify glass in the panel it redirects to a search "undefined"&lt;/P&gt;

&lt;P&gt;instead of map command if i use any other thing it gives results&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 05:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345181#M41805</guid>
      <dc:creator>sairamrambappa</dc:creator>
      <dc:date>2018-04-16T05:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345182#M41806</link>
      <description>&lt;P&gt;Can you share complete xml? Also can you try to define base search globally instead in panel. Refer this doc:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/Buildandeditforms#Create_a_form_with_a_global_search"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/Buildandeditforms#Create_a_form_with_a_global_search&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 12:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345182#M41806</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-16T12:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345183#M41807</link>
      <description>&lt;P&gt;You can solve your most immediate issue by replacing this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|map search="search index=offered reportname=$reportname$ |table Offer"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| map [ search index=offered reportname="$$reportname$$" | table Offer ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See the following two docs for info about needing to wrap variable strings in double dollar signs when using &lt;CODE&gt;map&lt;/CODE&gt; in a dashboard:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Map"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.3/SearchReference/Map&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/tokens"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/tokens&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But this is likely to run you into some timeout issues with the post-process search, and this is almost certainly not the most efficient way to return the results you're looking for. Given the overall structure of the base and post-process search, I'd strongly recommend doing away with the current approach and just use this as a single search with a subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
   &amp;lt;title&amp;gt;Offers&amp;lt;/title&amp;gt;
   &amp;lt;table&amp;gt;
     &amp;lt;search base="Extra"&amp;gt;
       &amp;lt;query&amp;gt;index=offered [ search index=reports | stats count by reportname | fields reportname ] | table Offer | dedup Offer &amp;lt;/query&amp;gt;
       &amp;lt;earliest&amp;gt;$time1.earliest$&amp;lt;/earliest&amp;gt;
       &amp;lt;latest&amp;gt;$time1.latest$&amp;lt;/latest&amp;gt;
     &amp;lt;/search&amp;gt;
     &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
     &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
   &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's a link to another post where I explain why map is generally a bad choice if you can avoid it at all:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/618837/why-is-my-map-command-returning-an-error-when-ther-1.html#comment-619077"&gt;https://answers.splunk.com/answers/618837/why-is-my-map-command-returning-an-error-when-ther-1.html#comment-619077&lt;/A&gt;&lt;BR /&gt;
It explains how Splunk expands a subsearch like the one I'm proposing here vs. how Splunk expands the mapped subsearches. &lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 14:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345183#M41807</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-16T14:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345184#M41808</link>
      <description>&lt;P&gt;| map [ search index=offered reportname="$$reportname$$" | table Offer ]&lt;/P&gt;

&lt;P&gt;This worked like a charm !! Thank you ............but its slow &lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 16:31:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345184#M41808</guid>
      <dc:creator>sairamrambappa</dc:creator>
      <dc:date>2018-04-16T16:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345185#M41809</link>
      <description>&lt;P&gt;Yes, it will definitely be slow. I strongly urge you to change your approach to direct subsearch that I offered in the XML code sample above! &lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 16:46:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345185#M41809</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-16T16:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345186#M41810</link>
      <description>&lt;P&gt;But When the "map" panel has no values it is giving an error like dis &lt;/P&gt;

&lt;P&gt;Error in 'map': Did not find value for required attribute 'reportname'.&lt;/P&gt;

&lt;P&gt;is there any way I can hide this ?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 17:39:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345186#M41810</guid>
      <dc:creator>sairamrambappa</dc:creator>
      <dc:date>2018-04-16T17:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345187#M41811</link>
      <description>&lt;P&gt;Do you want the whole panel hidden, or are you OK with it just saying no results found? If the latter, then just add &lt;CODE&gt;fill null reportname value=""&lt;/CODE&gt; before the call to map. &lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:54:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345187#M41811</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-16T18:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345188#M41812</link>
      <description>&lt;P&gt;The whole panel to be hidden until we have results.&lt;/P&gt;

&lt;P&gt;if there are no results I don't want it to show,please &lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:57:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345188#M41812</guid>
      <dc:creator>sairamrambappa</dc:creator>
      <dc:date>2018-04-16T18:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use "map" command in post process dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345189#M41813</link>
      <description>&lt;P&gt;Ok, in this case you'll need something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search id="Extra"&amp;gt;
       &amp;lt;query&amp;gt;index=reports | stats count by reportname&amp;lt;/query&amp;gt;
       &amp;lt;earliest&amp;gt;$time1.earliest$&amp;lt;/earliest&amp;gt;
       &amp;lt;latest&amp;gt;$time1.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="$job.resultCount$ != 0"&amp;gt;
        &amp;lt;set token="showResults"&amp;gt;&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
     &amp;lt;/search&amp;gt;
    &amp;lt;init&amp;gt;
      &amp;lt;unset token="showResults"&amp;gt;&amp;lt;/unset&amp;gt;
    &amp;lt;/init&amp;gt;
     &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
     &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
   &amp;lt;/table&amp;gt;
 &amp;lt;/panel&amp;gt;
 &amp;lt;panel depends="$showResults$"&amp;gt;
   &amp;lt;title&amp;gt;Offers&amp;lt;/title&amp;gt;
   &amp;lt;table&amp;gt;
     &amp;lt;search base="Extra"&amp;gt;
       &amp;lt;query&amp;gt; | map [ search index=offered reportname="$$reportname$$" | table Offer ] maxsearches=0 | dedup Offer &amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;
     &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
     &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
   &amp;lt;/table&amp;gt;
 &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This conditionally sets a token called "showResults" if the result count from the base search is not zero. If the token is set, then the panel will display. The token defaults to being unset because of the &lt;CODE&gt;&amp;lt;init&amp;gt;&lt;/CODE&gt; element.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 19:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Trying-to-use-quot-map-quot-command-in-post-process-dashboard/m-p/345189#M41813</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-04-16T19:32:08Z</dc:date>
    </item>
  </channel>
</rss>

