<?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 How to extract a substring based on its position within a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-based-on-its-position-within-a-field/m-p/256990#M76956</link>
    <description>&lt;P&gt;I have a field that is of the form &lt;CODE&gt;/Code153:4:Item1,Item2,Item3,Item4/Code211:2:Item5,Item6&lt;/CODE&gt; where I need to extract a substring in the form of &lt;CODE&gt;Code###:#:Item,Item,Item....&lt;/CODE&gt; based upon the location of a search. For example, if it was Item 2 I was searching for then the string &lt;CODE&gt;Code 153:4:Item1,Item2:Item3:Item4&lt;/CODE&gt; would be returned.&lt;/P&gt;

&lt;P&gt;I am stumped on how to accomplish this. &lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2016 21:00:03 GMT</pubDate>
    <dc:creator>mcgi906</dc:creator>
    <dc:date>2016-07-11T21:00:03Z</dc:date>
    <item>
      <title>How to extract a substring based on its position within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-based-on-its-position-within-a-field/m-p/256990#M76956</link>
      <description>&lt;P&gt;I have a field that is of the form &lt;CODE&gt;/Code153:4:Item1,Item2,Item3,Item4/Code211:2:Item5,Item6&lt;/CODE&gt; where I need to extract a substring in the form of &lt;CODE&gt;Code###:#:Item,Item,Item....&lt;/CODE&gt; based upon the location of a search. For example, if it was Item 2 I was searching for then the string &lt;CODE&gt;Code 153:4:Item1,Item2:Item3:Item4&lt;/CODE&gt; would be returned.&lt;/P&gt;

&lt;P&gt;I am stumped on how to accomplish this. &lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 21:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-based-on-its-position-within-a-field/m-p/256990#M76956</guid>
      <dc:creator>mcgi906</dc:creator>
      <dc:date>2016-07-11T21:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a substring based on its position within a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-based-on-its-position-within-a-field/m-p/256991#M76957</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search | eval yourfield=split(yourfield,"/") | eval filteredVal=mvfilter(match(yourfield,"Item2"))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jul 2016 21:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-based-on-its-position-within-a-field/m-p/256991#M76957</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-11T21:25:20Z</dc:date>
    </item>
  </channel>
</rss>

