<?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 can I remove text from _raw if it appears as a field in Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35476#M7780</link>
    <description>&lt;P&gt;I tried to create two capture groups .&lt;BR /&gt;
$1 = &lt;EM&gt;&lt;CONMAN&gt; Console [hype&lt;/CONMAN&gt;&lt;/EM&gt;. $2 =&lt;EM&gt;] log at 2013-08-15 00:00:00 PDT.&lt;BR /&gt;
2013-08-15 14:25:48 Setting hostname hype362: [ OK ]&lt;/EM&gt;.  The two capture groups exclude the &lt;EM&gt;33&lt;/EM&gt; value. using format = $1$1 to replace _raw the event should contain the whole event excluding &lt;EM&gt;33&lt;/EM&gt;. I know this works during indexing phase and should doing search.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2013 21:17:35 GMT</pubDate>
    <dc:creator>bmacias84</dc:creator>
    <dc:date>2013-08-20T21:17:35Z</dc:date>
    <item>
      <title>How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35469#M7773</link>
      <description>&lt;P&gt;I want to remove a string from _raw that appears as a field in Splunk say host. For example if I have the _raw message:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ConMan&amp;gt; Console [hype33] log at 2013-08-15 00:00:00 PDT.
2013-08-15 14:25:48 Setting hostname hype362: [ OK ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The following search gets rid of date, time and any digits in _raw&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex mode=sed "s/\d{1,}//g" |rex mode=sed "s/(Jan|January|Feb|Febuary|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December|Mon|Tue|Wed|Thu|Fri|Sat|Sun)//g" | rename _raw AS msgdigest
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the msgdigest then becomes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ConMan&amp;gt; Console [hype] log at -- :: PDT.
-- :: Setting hostname hype: [ OK ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As my _raw message and say hype is a type of host I want to have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ConMan&amp;gt; Console [] log at -- :: PDT.
-- :: Setting hostname: [ OK ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The final goal here is to create a digest of _raw that has more detail than punct as I find that sometimes errors that are not actually similar have the same punct. So I am making hybrid of _raw and punct so to speak. I may try to make this available as an app in the long run.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 21:32:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35469#M7773</guid>
      <dc:creator>cpeteman</dc:creator>
      <dc:date>2013-08-14T21:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35470#M7774</link>
      <description>&lt;P&gt;If I assume correctly, you want to remove whatever's between the []. In your example of&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;CONMAN&gt; Console [hype] log at -- :: PDT.&lt;BR /&gt;
You want to get rid of the word &lt;EM&gt;hype&lt;/EM&gt;.&lt;/CONMAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I ran the following regex on for you on &lt;A href="http://gskinner.com/RegExr/"&gt;http://gskinner.com/RegExr/&lt;/A&gt; on the above line&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;(?&amp;lt;=\[).*?(?=\])&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This uses a positive lookbehind and a positive lookahead to search for the first [ and the first ] symbol and select everything in between. You could use this to do a find/replace and replace the text selected by the regex with nothing to get rid of it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2013 17:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35470#M7774</guid>
      <dc:creator>lcrielaa</dc:creator>
      <dc:date>2013-08-15T17:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35471#M7775</link>
      <description>&lt;P&gt;I'm afraid this will only cover a few cases the [] do not always have anything to do with the field I also want to get rid of stuff like user names with aren't ever in brackets. Thanks for trying.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2013 20:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35471#M7775</guid>
      <dc:creator>cpeteman</dc:creator>
      <dc:date>2013-08-15T20:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35472#M7776</link>
      <description>&lt;P&gt;You will need to use a transform.conf and props.conf.  You you will do a capture and exclude the values you don't want and apply it at search time with REPORT.  I didnt check my regex but this should give you some ideas.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
#transform.conf&lt;BR /&gt;
[data-anonymizer]&lt;BR /&gt;
REGEX = (?m)^(.*\[\w[^\d])\d+(\].*)&lt;BR /&gt;
FORMAT = $1$2&lt;BR /&gt;
DEST_KEY = _raw&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
#props.conf&lt;BR /&gt;
[yoursource]&lt;BR /&gt;
REPORT-anonymizer=data-anonymizer&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps or gives you some ideas.  Dont forget to vote and accept answers that help.&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2013 22:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35472#M7776</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-08-15T22:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35473#M7777</link>
      <description>&lt;P&gt;I feel as though Splunk needs to have an easy way to identify values of a field inside of regex (added on to just perl re). This would make it easier to do a lot of things or at least give us more options.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2013 15:31:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35473#M7777</guid>
      <dc:creator>using</dc:creator>
      <dc:date>2013-08-16T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35474#M7778</link>
      <description>&lt;P&gt;Fear not, I'm in the process of getting access to those files so it may take a day or two.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2013 17:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35474#M7778</guid>
      <dc:creator>cpeteman</dc:creator>
      <dc:date>2013-08-16T17:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35475#M7779</link>
      <description>&lt;P&gt;Can you explain a little more what you are doing with the regex?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 20:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35475#M7779</guid>
      <dc:creator>cpeteman</dc:creator>
      <dc:date>2013-08-20T20:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I remove text from _raw if it appears as a field in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35476#M7780</link>
      <description>&lt;P&gt;I tried to create two capture groups .&lt;BR /&gt;
$1 = &lt;EM&gt;&lt;CONMAN&gt; Console [hype&lt;/CONMAN&gt;&lt;/EM&gt;. $2 =&lt;EM&gt;] log at 2013-08-15 00:00:00 PDT.&lt;BR /&gt;
2013-08-15 14:25:48 Setting hostname hype362: [ OK ]&lt;/EM&gt;.  The two capture groups exclude the &lt;EM&gt;33&lt;/EM&gt; value. using format = $1$1 to replace _raw the event should contain the whole event excluding &lt;EM&gt;33&lt;/EM&gt;. I know this works during indexing phase and should doing search.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 21:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-remove-text-from-raw-if-it-appears-as-a-field-in/m-p/35476#M7780</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-08-20T21:17:35Z</dc:date>
    </item>
  </channel>
</rss>

