<?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: Rex Field=All Fields mode=sed in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237476#M3009</link>
    <description>&lt;P&gt;I tried this but it didn't work.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2016 17:41:30 GMT</pubDate>
    <dc:creator>tuanledang1120</dc:creator>
    <dc:date>2016-07-05T17:41:30Z</dc:date>
    <item>
      <title>Rex Field=All Fields mode=sed</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237472#M3005</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to do a sed (replacing comma with _) on all fields, instead of having to specify which field I want to do the sed command on. Is that possible? &lt;/P&gt;

&lt;P&gt;I tried to do field=*, but that did not work.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 04:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237472#M3005</guid>
      <dc:creator>tuanledang1120</dc:creator>
      <dc:date>2016-07-05T04:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Field=All Fields mode=sed</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237473#M3006</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;field=_raw&lt;/CODE&gt; OR you don't need to specify a field. You could just do &lt;CODE&gt;rex mode=sed "your regex"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 11:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237473#M3006</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-05T11:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Field=All Fields mode=sed</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237474#M3007</link>
      <description>&lt;P&gt;Alternatively you could use foreach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=replace(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, ",", "_" )]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jul 2016 12:32:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237474#M3007</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-05T12:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Field=All Fields mode=sed</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237475#M3008</link>
      <description>&lt;P&gt;If you like, you can take it to &lt;CODE&gt;props.conf&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;We do the following to remove spaces -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# :"   kkkki    " -- remove spaces
SEDCMD-trim-ws1 = s/(:\")(\s+)?(\w+)(\s+)?(\")/\1\3\5/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, it's a sed command at the &lt;CODE&gt;props.conf&lt;/CODE&gt; level.&lt;/P&gt;

&lt;P&gt;In your case, the following should work -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-replace = s/,/_/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jul 2016 13:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237475#M3008</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-07-05T13:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Field=All Fields mode=sed</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237476#M3009</link>
      <description>&lt;P&gt;I tried this but it didn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 17:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237476#M3009</guid>
      <dc:creator>tuanledang1120</dc:creator>
      <dc:date>2016-07-05T17:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Field=All Fields mode=sed</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237477#M3010</link>
      <description>&lt;P&gt;This works! Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 17:50:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Rex-Field-All-Fields-mode-sed/m-p/237477#M3010</guid>
      <dc:creator>tuanledang1120</dc:creator>
      <dc:date>2016-07-05T17:50:39Z</dc:date>
    </item>
  </channel>
</rss>

