<?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 Extraction of a substring and comparison in a loop in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284320#M85960</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need to search for an element A present in one of the fields let's say field 1.&lt;/P&gt;

&lt;P&gt;Some of the values present for field1 in various rows are&lt;BR /&gt;
Row1: field1=C,D&lt;BR /&gt;
Row2: field1=E,F,A, ....&lt;/P&gt;

&lt;P&gt;I need to do a extract each of the elements present  before the comma (,) and compare to see if its A across rows.&lt;/P&gt;

&lt;P&gt;Is there a way in Splunk to perform this capability?&lt;/P&gt;

&lt;P&gt;Any help in solving this is greatly appreciated.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Dilip&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2016 02:27:34 GMT</pubDate>
    <dc:creator>diliptmonson</dc:creator>
    <dc:date>2016-02-18T02:27:34Z</dc:date>
    <item>
      <title>Extraction of a substring and comparison in a loop</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284320#M85960</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need to search for an element A present in one of the fields let's say field 1.&lt;/P&gt;

&lt;P&gt;Some of the values present for field1 in various rows are&lt;BR /&gt;
Row1: field1=C,D&lt;BR /&gt;
Row2: field1=E,F,A, ....&lt;/P&gt;

&lt;P&gt;I need to do a extract each of the elements present  before the comma (,) and compare to see if its A across rows.&lt;/P&gt;

&lt;P&gt;Is there a way in Splunk to perform this capability?&lt;/P&gt;

&lt;P&gt;Any help in solving this is greatly appreciated.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
Dilip&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 02:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284320#M85960</guid>
      <dc:creator>diliptmonson</dc:creator>
      <dc:date>2016-02-18T02:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of a substring and comparison in a loop</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284321#M85961</link>
      <description>&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   your search  |eval Result=if(mvindex(split(field1,","),0) =="A","YES","NO")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Feb 2016 09:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284321#M85961</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-02-18T09:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of a substring and comparison in a loop</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284322#M85962</link>
      <description>&lt;P&gt;Do you need to know when row has field1 with A as one of the value?? IF that's the case, you can try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | where isnotnull(mvfind(split(find,","),"A"))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Feb 2016 17:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-of-a-substring-and-comparison-in-a-loop/m-p/284322#M85962</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-18T17:31:36Z</dc:date>
    </item>
  </channel>
</rss>

