<?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: Extract substring from field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134851#M36848</link>
    <description>&lt;P&gt;Try &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/Replace"&gt;replace&lt;/A&gt;. Maybe something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;… | replace idfromchart* with idfromchart in yourfieldname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or…&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;… | replace "*(reverse)" with "*" in yourfieldname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd go with the latter option first, actually.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Nov 2013 00:42:10 GMT</pubDate>
    <dc:creator>jtrucks</dc:creator>
    <dc:date>2013-11-09T00:42:10Z</dc:date>
    <item>
      <title>Extract substring from field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134849#M36846</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm facing a problem with string extraction . The scenario is as follows: I'm passing an ID from one chart to another form through URL and, before populating it to the new charts, I need to "remove" some additional data from that string. &lt;/P&gt;

&lt;P&gt;Let's say that I receive this kind of string ID: "idfromchart(reverse)" through the URL and I need just the "idfromchart" without the "(reverse)" part. First I need to format the id to the correct value, then I'll try to populate it actually...one step at a time &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Any help provided it would be really appreciated.&lt;BR /&gt;
Thanks! &lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 16:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134849#M36846</guid>
      <dc:creator>alesSantiago</dc:creator>
      <dc:date>2013-11-08T16:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract substring from field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134850#M36847</link>
      <description>&lt;P&gt;For your step1. Formatting of id (assuming the format of the URL parameter is same as your example, means it contains "(" symbol.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* |head 1| eval body="somestring(reverse)" | table body | eval body1=mvindex(split(body,"("),0) |rex field=body "(?&amp;lt;body2&amp;gt;[^(]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can use any one of body1 or body2 for your formatting.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2013 17:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134850#M36847</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-08T17:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract substring from field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134851#M36848</link>
      <description>&lt;P&gt;Try &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/Replace"&gt;replace&lt;/A&gt;. Maybe something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;… | replace idfromchart* with idfromchart in yourfieldname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or…&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;… | replace "*(reverse)" with "*" in yourfieldname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd go with the latter option first, actually.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2013 00:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134851#M36848</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-11-09T00:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract substring from field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134852#M36849</link>
      <description>&lt;P&gt;The second option happened to format the ID to what I wanted. Thanks.&lt;BR /&gt;
Out of this question, would you be able to tell me if the &lt;DEFAULT&gt; tag supports queries? I'm thinking about how to populate the formatted id and populate it to the rest of the charts through a dropdown.&lt;BR /&gt;
thanks again!&lt;/DEFAULT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2013 12:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134852#M36849</guid>
      <dc:creator>alesSantiago</dc:creator>
      <dc:date>2013-11-11T12:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract substring from field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134853#M36850</link>
      <description>&lt;P&gt;Thanks for your answer. &lt;BR /&gt;
I did try this solution, but I wasn't able to make it work the way I wanted. &lt;BR /&gt;
So the reason why I didn't mark it as a valid answer was not about that it might be or not correct (sure it is), it is about my lack of knowledge in regex. It might be useful for somebody else.&lt;BR /&gt;
thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2013 12:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-substring-from-field/m-p/134853#M36850</guid>
      <dc:creator>alesSantiago</dc:creator>
      <dc:date>2013-11-11T12:29:11Z</dc:date>
    </item>
  </channel>
</rss>

