<?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: Why is there a problem when passing a command through a variable in map-command? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430677#M41279</link>
    <description>&lt;P&gt;Also, see this Q&amp;amp;A for a super-flexible general approach to handle this kind of thing:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/719456/how-to-prevent-the-map-command-from-encapsulating.html?childToView=719011#answer-719011"&gt;https://answers.splunk.com/answers/719456/how-to-prevent-the-map-command-from-encapsulating.html?childToView=719011#answer-719011&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jan 2019 22:53:34 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-01-28T22:53:34Z</dc:date>
    <item>
      <title>Why is there a problem when passing a command through a variable in map-command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430672#M41274</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Threshold_Perfil.csv 
| join perfil max=0 
    [| inputlookup Perfis_Threshold.csv 
    | fields perfil counter object 
    | dedup perfil counter object ] 
| eval counter= "counter='"."".counter.""."' " 
| eval object= " object='".object."' " 
| eval cmdline= " (".counter.object.") OR " 
| stats values(cmdline) as cmdline by host perfil 
| mvcombine delim="," cmdline 
| head 10 
| map search="earliest=-1h index="main" $cmdline$ sourcetype="nullableone" | stats count by object counter"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm using search above trying to pass a collection of counter and objects to make my search...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(counter='% Processor Time' object='Processor' ) OR (counter='Status' object='SWInterface' ) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have many servers and I want to check if Splunk is collecting correctly in each server, but when I'm passing my "cmdline" my map command is not running because splunk adds quotes after and before "cmdline" field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1h index=main " (counter='% Processor Time' object='Processor' ) OR (counter='Status' object='SWInterface' ) OR (counter='Temperatura' object='Temperatura' ) OR (counter='network_updown' object='ping' ) OR (counter='snmpwalk' object='bgp_router_status' ) OR " sourcetype=nullableone | stats count by object counter'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If there is another way to do this I'll be happy to see.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 11:37:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430672#M41274</guid>
      <dc:creator>ppatrikfr</dc:creator>
      <dc:date>2018-07-10T11:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a problem when passing a command through a variable in map-command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430673#M41275</link>
      <description>&lt;P&gt;@ppatrikfr do you have some sample values for &lt;CODE&gt;cmdline&lt;/CODE&gt;. Also do you want to use it as text filter or key value pair? From he query seems like it is a text filter.&lt;/P&gt;

&lt;P&gt;Also is the issue while running above in Splunk Search window or in Dashboard?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 11:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430673#M41275</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-10T11:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a problem when passing a command through a variable in map-command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430674#M41276</link>
      <description>&lt;P&gt;cmdline = &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(counter='% Processor Time' object='Processor' ) OR (counter='Status' object='SWInterface' ) OR (counter='Temperatura' object='Temperatura' ) OR (counter='network_updown' object='ping' ) OR (counter='snmpwalk' object='bgp_router_status' ) OR
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just want splunk to identify as search command but those quotes are making them just a text filter. Also I'm running in window not dashboard.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 12:16:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430674#M41276</guid>
      <dc:creator>ppatrikfr</dc:creator>
      <dc:date>2018-07-10T12:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a problem when passing a command through a variable in map-command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430675#M41277</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Threshold_Perfil.csv 
| join perfil max=0 
    [| inputlookup Perfis_Threshold.csv 
    | fields perfil counter object 
    | dedup perfil counter object ] 
|  eval counter="counter='".counter."' " 
| eval object=" object='".object."' " 
| eval cmdline= "(".counter.object.")" 
| stats values(cmdline) as cmdline by host delim=" OR " | nomv cmdline 
| head 10 
| map search="search earliest=-1h index="main" [gentimes start=-1 | eval search=\"$cmdline$\" | rex mode=sed field=search "s/\\\"//g" | table search]  sourcetype="nullableone" | stats count by object counter"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jul 2018 15:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430675#M41277</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-10T15:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a problem when passing a command through a variable in map-command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430676#M41278</link>
      <description>&lt;P&gt;Exactly what I was going to propose.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 16:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430676#M41278</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-07-10T16:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is there a problem when passing a command through a variable in map-command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430677#M41279</link>
      <description>&lt;P&gt;Also, see this Q&amp;amp;A for a super-flexible general approach to handle this kind of thing:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/719456/how-to-prevent-the-map-command-from-encapsulating.html?childToView=719011#answer-719011"&gt;https://answers.splunk.com/answers/719456/how-to-prevent-the-map-command-from-encapsulating.html?childToView=719011#answer-719011&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 22:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-there-a-problem-when-passing-a-command-through-a-variable/m-p/430677#M41279</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-28T22:53:34Z</dc:date>
    </item>
  </channel>
</rss>

