<?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 edit my rex mode=sed syntax to remove parts of a string value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231610#M68704</link>
    <description>&lt;P&gt;Good point. I believe &lt;CODE&gt;field19&lt;/CODE&gt; has the values&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Interesting_String_Value | top 10 field19 | rev field=field19 "\"(?&amp;lt;field19&amp;gt;[^\"]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Aug 2016 03:20:34 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-08-18T03:20:34Z</dc:date>
    <item>
      <title>How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231603#M68697</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Apologies if this has been asked before (or if there is a much easier way of doing this), I haven't been able to identify any relevant posts elsewhere...&lt;/P&gt;

&lt;P&gt;I've got a simple chart I'm trying to modify. Basically, it looks at a syslog message and charts the top 10 'x' based on the number of messages that have been generated.&lt;/P&gt;

&lt;P&gt;Pseudo-search-code looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Interesting_String_Value | top 10 field19
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, what comes out of it is a chart (top 10) as you would expect, but the values look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;field-description="actual_value"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to remove all pieces except for the actual_value (including quotations)&lt;/P&gt;

&lt;P&gt;I'd assume I could handle this via &lt;CODE&gt;rex mode=sed&lt;/CODE&gt;, but I'm not having any luck...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex mode=sed 's/field-description\=//g;s/\"//g'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Help? : )&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 17:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231603#M68697</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-17T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231604#M68698</link>
      <description>&lt;P&gt;I suspect you need two separate commands.  Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex mode=sed 's/field-description\=//g' | rex mode=sed 's/\"//g' | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | replace "field-description=" with "" in field19 | replace '"' with '' in field19 | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 17:56:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231604#M68698</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-08-17T17:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231605#M68699</link>
      <description>&lt;P&gt;Try this (wasn't sure if you wanted to keep the quotes or remove, this removes the quotes. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.. | rex mode=sed "s/.*"([^"]+)"/$1/g" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR this, if you want to retain the quotes&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex mode=sed "s/.*("[^"]+")/$1/g" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 18:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231605#M68699</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-17T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231606#M68700</link>
      <description>&lt;P&gt;Sadly both seem to have the same effect... (nothing). field-description="" is still there. Even trying just 'field-description' removal doesn't seem to work.&lt;/P&gt;

&lt;P&gt;Thanks for the help,&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 18:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231606#M68700</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-17T18:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231607#M68701</link>
      <description>&lt;P&gt;I get some...interesting errors with both of those.&lt;/P&gt;

&lt;P&gt;I'd like to have the output in the chart be:&lt;/P&gt;

&lt;P&gt;actual_value&lt;/P&gt;

&lt;P&gt;instead of&lt;/P&gt;

&lt;P&gt;field-description="actual_value"&lt;/P&gt;

&lt;P&gt;Error in 'SearchParser': Missing a search command before '^'.&lt;BR /&gt;
where field19 != "...{snipped} {errorcontext = d "s/.*"([^"]+)"/$1/g}'.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 18:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231607#M68701</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-17T18:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231608#M68702</link>
      <description>&lt;P&gt;My bad. Forgot to escape the quotes. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex mode=sed "s/.*\"([^\"]+)\"/\1/g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Aug 2016 02:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231608#M68702</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-18T02:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231609#M68703</link>
      <description>&lt;P&gt;just wondering why you want rex mode=sed, maybe, just a regular rex field extraction is enough.. just a thought - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Interesting_String_Value | top 10 field19 | rex field=_raw "actual-field-description="(?&amp;lt;actual_value&amp;gt;[maybe \w+ \d+])"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;updated from Sundaresh Sir's comment - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Interesting_String_Value | top 10 field19 | rex field=field19 "\"(?&amp;lt;field19&amp;gt;[^\"]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Aug 2016 03:11:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231609#M68703</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-18T03:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231610#M68704</link>
      <description>&lt;P&gt;Good point. I believe &lt;CODE&gt;field19&lt;/CODE&gt; has the values&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Interesting_String_Value | top 10 field19 | rev field=field19 "\"(?&amp;lt;field19&amp;gt;[^\"]+)\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Aug 2016 03:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231610#M68704</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-18T03:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231611#M68705</link>
      <description>&lt;P&gt;Sorry, I should have caught that as well. This one runs, but the end result is still the same in the chart &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 13:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231611#M68705</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-18T13:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231612#M68706</link>
      <description>&lt;P&gt;Sundareshr's worked! Thank you!&lt;/P&gt;

&lt;P&gt;Do you want to pop that into an answer for credit?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 13:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231612#M68706</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-18T13:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231613#M68707</link>
      <description>&lt;P&gt;(obviously substituted 'rev' for 'rex'&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 13:35:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231613#M68707</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-18T13:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231614#M68708</link>
      <description>&lt;P&gt;Yes Please &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; .. an upvote and/or accept as answer would be Great ! &lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 14:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231614#M68708</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-18T14:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231615#M68709</link>
      <description>&lt;P&gt;Not seeing a way to do this for a comment - maybe if you repost it as a top-level answer?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 15:40:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231615#M68709</guid>
      <dc:creator>NuMPTy</dc:creator>
      <dc:date>2016-08-18T15:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my rex mode=sed syntax to remove parts of a string value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231616#M68710</link>
      <description>&lt;P&gt;not this comment.. this whole reply, you can "Accept this as answer".. also the upvote button(^)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 16:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-rex-mode-sed-syntax-to-remove-parts-of-a-string/m-p/231616#M68710</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-18T16:20:58Z</dc:date>
    </item>
  </channel>
</rss>

