<?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 Remove character pattern from field value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368792#M160611</link>
    <description>&lt;P&gt;In one of my logs, I have some fields that return values such as:&lt;BR /&gt;
status=FA-Full Pulse AOV Access Realm)[&lt;BR /&gt;
status=FA-Full Pulse AOV Access Realm)[FA-CGK Bypass Role&lt;BR /&gt;
status=unknown)[&lt;/P&gt;

&lt;P&gt;What is the best way to strip the ")[" pattern from each of these values and replace with something like a blank space (ie " ").  I tried &lt;CODE&gt;replace ")[" WITH " " IN status&lt;/CODE&gt; but it doesn't seem to be doing anything.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2017 20:14:11 GMT</pubDate>
    <dc:creator>bcarr12</dc:creator>
    <dc:date>2017-06-22T20:14:11Z</dc:date>
    <item>
      <title>Remove character pattern from field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368792#M160611</link>
      <description>&lt;P&gt;In one of my logs, I have some fields that return values such as:&lt;BR /&gt;
status=FA-Full Pulse AOV Access Realm)[&lt;BR /&gt;
status=FA-Full Pulse AOV Access Realm)[FA-CGK Bypass Role&lt;BR /&gt;
status=unknown)[&lt;/P&gt;

&lt;P&gt;What is the best way to strip the ")[" pattern from each of these values and replace with something like a blank space (ie " ").  I tried &lt;CODE&gt;replace ")[" WITH " " IN status&lt;/CODE&gt; but it doesn't seem to be doing anything.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 20:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368792#M160611</guid>
      <dc:creator>bcarr12</dc:creator>
      <dc:date>2017-06-22T20:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Remove character pattern from field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368793#M160612</link>
      <description>&lt;P&gt;If you want to permanently remove these characters, that can be done at parsing time.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetypehere]
TRANSFORMS=fixChar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[fixChar]
SOURCE_KEY=_raw
REGEX=(.*)\)\[(.*)
DEST_KEY=_raw
FORMAT=$1 $2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might not want to set this up exactly as I have shown in this example, but it will probably work. Remember that you can't use the status field in the transform, because it doesn't exist at this point.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 20:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368793#M160612</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-06-22T20:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Remove character pattern from field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368794#M160613</link>
      <description>&lt;P&gt;Replace should work, but perhaps it's confused by the paren and bracket.  Try &lt;CODE&gt;rex&lt;/CODE&gt;.  It &lt;EM&gt;will&lt;/EM&gt; be confused by the paren and bracket so they'll need to be escaped.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex mode=sed "s/\)\[/ /g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jun 2017 21:04:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368794#M160613</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-06-22T21:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Remove character pattern from field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368795#M160614</link>
      <description>&lt;P&gt;Thanks!  This works great.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 12:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368795#M160614</guid>
      <dc:creator>bcarr12</dc:creator>
      <dc:date>2017-06-23T12:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Remove character pattern from field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368796#M160615</link>
      <description>&lt;P&gt;If I can be a pain - can rex also be used if I wanted to replace the )[ with something like a pipe?  Just trying to find an easy way to seperate the values when there is more than one status.&lt;/P&gt;

&lt;P&gt;For instance:&lt;BR /&gt;
status=FA-Full Pulse AOV Access Realm | &lt;BR /&gt;
status=FA-Full Pulse AOV Access Realm | FA-CGK Bypass Role&lt;BR /&gt;
status=unknown |&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 12:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-character-pattern-from-field-value/m-p/368796#M160615</guid>
      <dc:creator>bcarr12</dc:creator>
      <dc:date>2017-06-26T12:57:05Z</dc:date>
    </item>
  </channel>
</rss>

