<?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: Remove numbers from splunk events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71900#M17967</link>
    <description>&lt;P&gt;You can try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=eventlogs | eval MSG=replace(MSG,"\d+","N") | stats count by MSG
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 22 Jun 2013 00:21:12 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2013-06-22T00:21:12Z</dc:date>
    <item>
      <title>Remove numbers from splunk events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71898#M17965</link>
      <description>&lt;P&gt;I"m trying to create a search that will show me the count of certain types of events I get in a Windows Event Log.   The problem I'm having is that the field I'm keying on (MSG) often has unique numerical values for the same event. &lt;/P&gt;

&lt;P&gt;Example: &lt;BR /&gt;&lt;BR /&gt;
Event1:  There is no object at postion 2&lt;BR /&gt;&lt;BR /&gt;
Event2:  There is no object at position 22&lt;BR /&gt;&lt;BR /&gt;
Event3:  There is no object at position 34&lt;BR /&gt;&lt;BR /&gt;
Event4:  Wait time has been 22 seconds&lt;BR /&gt;&lt;BR /&gt;
Event5:  Wait time has been 45 seconds&lt;BR /&gt;&lt;BR /&gt;
Event6:  Wait time has been 127 seconds&lt;/P&gt;

&lt;P&gt;If I did the following search:  index=eventlogs | stats count by MSG   I would get 6 rows of data, each with a count of 1, where I'd really like it to tell me I have 2 events, with a count of 3 for each.  In the example above, I have 2 event types, but the different unique numerical values in the data for each field makes it look like I have 6 different event types.  Is there a way I can have splunk ignore the numerical values?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2013 23:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71898#M17965</guid>
      <dc:creator>richnavis</dc:creator>
      <dc:date>2013-06-21T23:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbers from splunk events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71899#M17966</link>
      <description>&lt;P&gt;You should should setup an eventtypes.conf. You can probably define the eventtype through the gui as well. But I am used to working in the config files. &lt;/P&gt;

&lt;P&gt;You can do like this in eventtypes.conf&lt;/P&gt;

&lt;P&gt;[MyEvents-NoObject]&lt;/P&gt;

&lt;P&gt;search = index=eventlogs sourcetype=WinEventLog:Application MSG="*There is no object*"&lt;/P&gt;

&lt;P&gt;[MyEvents-WaitTime]&lt;/P&gt;

&lt;P&gt;search = index=eventlogs sourcetype=WinEventLog:Application MSG="*Wait time has been*"&lt;/P&gt;

&lt;P&gt;Now with that configuration in play you should see that each of your search results has an eventtype matching it. So you could now do a search like:&lt;BR /&gt;
index=eventlogs | stats count by eventtype&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2013 00:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71899#M17966</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2013-06-22T00:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbers from splunk events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71900#M17967</link>
      <description>&lt;P&gt;You can try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=eventlogs | eval MSG=replace(MSG,"\d+","N") | stats count by MSG
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jun 2013 00:21:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71900#M17967</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-06-22T00:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbers from splunk events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71901#M17968</link>
      <description>&lt;P&gt;Thanks..  I didn't think to use event types.. but perhaps I will use them for some other things I do.  However, in this case, the number of type of events could number in the hundreds, making event types impractical.. good suggestion tho...&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2013 16:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71901#M17968</guid>
      <dc:creator>richnavis</dc:creator>
      <dc:date>2013-07-02T16:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbers from splunk events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71902#M17969</link>
      <description>&lt;P&gt;Nice..  is there also a way to do a similar type thing for anything between parenthesis?  So.. if the event had something like "System Error(cart value=roses) has occurred", I could ignore the value inside the paraenthesis?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2013 16:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71902#M17969</guid>
      <dc:creator>richnavis</dc:creator>
      <dc:date>2013-07-02T16:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbers from splunk events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71903#M17970</link>
      <description>&lt;P&gt;You can use any regex with &lt;CODE&gt;replace()&lt;/CODE&gt;. So &lt;CODE&gt;replace(MSG,"\([^\)]*\)","(P)"&lt;/CODE&gt; would work for (non-nested) parens.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2013 16:28:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-numbers-from-splunk-events/m-p/71903#M17970</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-07-02T16:28:16Z</dc:date>
    </item>
  </channel>
</rss>

