<?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 generate search from dashboard input with variable number of values? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342566#M43113</link>
    <description>&lt;P&gt;You can edit the value of the text field with a subquery.&lt;/P&gt;

&lt;P&gt;index=XXX [search noop|stats count | eval dest="$ip$"|eval  dest=split(dest," ")  |table dest]|････&lt;BR /&gt;
↓Correct.&lt;BR /&gt;
index=XXX  [| noop|stats count | eval dest="$ip$"|eval  dest=split(dest," ")  |mvexpand dest|fields dest] |････&lt;BR /&gt;
（It still worked）&lt;BR /&gt;
index=XXX  [| noop|stats count | eval dest="$ip$"|eval  dest=split(dest," ") |fields dest] |････&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2017 16:07:00 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2017-03-08T16:07:00Z</dc:date>
    <item>
      <title>How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342565#M43112</link>
      <description>&lt;P&gt;This seems to be a very simple requirement, but I'm unable to find a solution: I built a dashboard where the user enters an ip address which will then be used in a search like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;dest=$ip$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now what I need is a way to search for 1 or more ip addresses. So, if the user enters "10.1.1.1 10.2.2.8 10.3.3.3" then the following search must be generated:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(dest=10.1.1.1 OR dest=10.2.2.8  OR dest=10.3.3.3)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 09:31:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342565#M43112</guid>
      <dc:creator>sptz16</dc:creator>
      <dc:date>2017-03-08T09:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342566#M43113</link>
      <description>&lt;P&gt;You can edit the value of the text field with a subquery.&lt;/P&gt;

&lt;P&gt;index=XXX [search noop|stats count | eval dest="$ip$"|eval  dest=split(dest," ")  |table dest]|････&lt;BR /&gt;
↓Correct.&lt;BR /&gt;
index=XXX  [| noop|stats count | eval dest="$ip$"|eval  dest=split(dest," ")  |mvexpand dest|fields dest] |････&lt;BR /&gt;
（It still worked）&lt;BR /&gt;
index=XXX  [| noop|stats count | eval dest="$ip$"|eval  dest=split(dest," ") |fields dest] |････&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 16:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342566#M43113</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-03-08T16:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342567#M43114</link>
      <description>&lt;P&gt;I think you need an mvexpand command as well (after split).&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 16:35:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342567#M43114</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-08T16:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342568#M43115</link>
      <description>&lt;P&gt;I also thought so.&lt;BR /&gt;
But just by splitting it worked fine.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 00:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342568#M43115</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-03-09T00:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342569#M43116</link>
      <description>&lt;P&gt;For an explanation of how HiroshiSatoh's answer works, see the "format" command.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/Search/Changetheformatofsubsearchresults"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.2/Search/Changetheformatofsubsearchresults&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 05:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342569#M43116</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-09T05:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342570#M43117</link>
      <description>&lt;P&gt;Holy cow, works like a charm! Thanks a lot, HiroshiSatoh!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 09:05:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342570#M43117</guid>
      <dc:creator>sptz16</dc:creator>
      <dc:date>2017-03-16T09:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342571#M43118</link>
      <description>&lt;P&gt;Ah, but now it's getting more complicated. I need to search for the address list in src AND dest fields, so I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search noop | stats count | eval src="$cidr" | eval src=split(src, " "), dest=split(src, " ") |
 table src, dest ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it only returns events where src matches. And this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search noop | stats count | eval src="$cidr",dest="$cidr"
 | eval src=split(src, " "), dest=split(dest, " ")
 | table src, dest ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;yields no results at all &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 09:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342571#M43118</guid>
      <dc:creator>sptz16</dc:creator>
      <dc:date>2017-03-16T09:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate search from dashboard input with variable number of values?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342572#M43119</link>
      <description>&lt;P&gt;Please perform sub search separately.&lt;/P&gt;

&lt;P&gt;index=XXX [| noop|stats count | eval src="$cidr$"|eval src=split(src," ") |mvexpand src|fields src]   [| noop|stats count | eval dest="$cidr$"|eval dest=split(dest," ") |mvexpand dest|fields dest] |････&lt;BR /&gt;
↓&lt;BR /&gt;
( (src=XXX) OR (src=XXX)  OR (src=XXX) OR (src=XXX) ) AND  ( (dest=XXX) OR (dest=XXX)  OR (dest=XXX) OR (dest=XXX) ) &lt;BR /&gt;
※Please be careful because it is AND condition.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 06:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-generate-search-from-dashboard-input-with-variable-number/m-p/342572#M43119</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-03-24T06:56:38Z</dc:date>
    </item>
  </channel>
</rss>

