<?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: Comparing multivalue field with single value field (v6.5.2) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368635#M108651</link>
    <description>&lt;P&gt;If you're using Splunk 6.6 OR above, you get an &lt;CODE&gt;IN&lt;/CODE&gt; operator in your search command using which you can search multiple values. I belive something like this would work (for comma separated list of IPs)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch src_ip IN ($IPs$)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See this for more details&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Search#Multiple_field-value_comparisons_with_the_IN_operator"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Search#Multiple_field-value_comparisons_with_the_IN_operator&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Apr 2018 15:31:43 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-04-27T15:31:43Z</dc:date>
    <item>
      <title>Comparing multivalue field with single value field (v6.5.2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368634#M108650</link>
      <description>&lt;P&gt;I was looking for a way to input multiple text inputs on a dashboard and searching the inputs against a single value field, and I have concluded that splunk has no other way to handle multi text input with the exception of created an inputlookup table or creating a multivalue input and using makemv and mvexpand. (correct me if i am wrong). And i do not want to create a inputlookup table&lt;/P&gt;

&lt;P&gt;Problem now is how would i compare the values in the multivalue field and a single value field &lt;BR /&gt;
Below is my spl:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [stats count| eval my_mv="$IPs$"|makemv my_mv delim="," | mvexpand my_mv ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;basically i have an input of multiple IPs(my_mv) and i want to search these IPs against an existing srcip field and return the events associated with the matched srcip.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 06:21:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368634#M108650</guid>
      <dc:creator>esmonder</dc:creator>
      <dc:date>2018-04-27T06:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multivalue field with single value field (v6.5.2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368635#M108651</link>
      <description>&lt;P&gt;If you're using Splunk 6.6 OR above, you get an &lt;CODE&gt;IN&lt;/CODE&gt; operator in your search command using which you can search multiple values. I belive something like this would work (for comma separated list of IPs)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch src_ip IN ($IPs$)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See this for more details&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Search#Multiple_field-value_comparisons_with_the_IN_operator"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Search#Multiple_field-value_comparisons_with_the_IN_operator&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368635#M108651</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-27T15:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multivalue field with single value field (v6.5.2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368636#M108652</link>
      <description>&lt;P&gt;A multiselect input field can produce an output token value that looks like...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( ( field1="value1" ) OR ( field1="value2" ) OR ( field1="value3" ) ... )
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You do that by setting the input's &lt;CODE&gt;&amp;lt;valueprefix&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;valuesuffix&amp;gt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;delimiter&amp;gt;&lt;/CODE&gt; tags.&lt;/P&gt;

&lt;P&gt;See this for more info &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/PanelreferenceforSimplifiedXML"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.3/Viz/PanelreferenceforSimplifiedXML&lt;/A&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;You can create a similar effect in code, by putting the code inside the brackets of a subsearch, using the &lt;CODE&gt;format&lt;/CODE&gt; command with parameters as desired, and then optionally using a &lt;CODE&gt;rex mode=sed field=search "s/some thing/some other thing/g"&lt;/CODE&gt; command to customize &lt;EM&gt;some thing&lt;/EM&gt; into &lt;EM&gt;some other thing&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 22:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368636#M108652</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-04-27T22:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing multivalue field with single value field (v6.5.2)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368637#M108653</link>
      <description>&lt;P&gt;Hi somesoni2, i am aware of the IN operator for 6.6 and beyond, unfortunately, we would not be upgrading the Splunk platform anytime soon &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 02:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-multivalue-field-with-single-value-field-v6-5-2/m-p/368637#M108653</guid>
      <dc:creator>esmonder</dc:creator>
      <dc:date>2018-04-30T02:51:15Z</dc:date>
    </item>
  </channel>
</rss>

