<?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 take out numeric numbers at the end of the event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196847#M56825</link>
    <description>&lt;P&gt;To get rid of a number at the end of an event at search time you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | rex mode=sed "s/\s*\d+(\.\d+)\s*$//"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That looks for a number, possibly with decimal places, and removes it along with surrounding whitespace if and only if the number is at the end of the event. You can restrict this to a specific field by specifying &lt;CODE&gt;field=name&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Note, your example event had an additional literal dot at the end of the event - if that's accurate you'll need to amend the regex like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;s/\s*\d+(\.\d+)\s*\.?$//
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Mar 2014 23:53:00 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-03-20T23:53:00Z</dc:date>
    <item>
      <title>how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196842#M56820</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I need little help from good Regexp guy, or may be i m so bad that the guy could be moderate. &lt;BR /&gt;
I have a log file that i need to categorize errors.&lt;/P&gt;

&lt;P&gt;my regexp is : &lt;CODE&gt;(?i)^(?:[^ ]* ){8}(?P&amp;lt;MY_VALUE&amp;gt;.+)(?=\d{8}\.)&lt;/CODE&gt; -&amp;gt; matches first line, ignores any other type&lt;/P&gt;

&lt;P&gt;here is the 2 events: &lt;BR /&gt;
Mask failed to grab activity for response 1234567.&lt;BR /&gt;
Error in Application  for PID 3131: System.Exception: Error processing the following address: &lt;/P&gt;

&lt;P&gt;So my question is I want to match both lines. Problem there is, in order to identify overall performance for my system, I need to get rid of ID numbers.(it is at end of the first line, ignore the digits after PID- I need them &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ) So first line should match until numbers whereas second line matched totally. &lt;/P&gt;

&lt;P&gt;I tried some but I couldn't figure out how to ensure that. &lt;/P&gt;

&lt;P&gt;Thanks in advance for your time and effort.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 20:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196842#M56820</guid>
      <dc:creator>axl88</dc:creator>
      <dc:date>2014-03-20T20:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196843#M56821</link>
      <description>&lt;P&gt;You want to remove them from the event data itself or you want to remove them from just the search result?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 21:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196843#M56821</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-20T21:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196844#M56822</link>
      <description>&lt;P&gt;It is search result. I can't remove event data as I ll be getting it remotely. &lt;BR /&gt;
I have two panels in dashboard, &lt;BR /&gt;
User selection in "master view" would detail chosen value in "detail view". &lt;BR /&gt;
I m on the step to detail logs for detail view. &lt;/P&gt;

&lt;P&gt;Since JavaScript would come to play, I should create generic extracted field for each log that I can minimize the complexity in JavaScript. &lt;/P&gt;

&lt;P&gt;My plan is to extract field with the pattern I desire above&lt;BR /&gt;
and use it for a search that will come through JS perma-link.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 21:18:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196844#M56822</guid>
      <dc:creator>axl88</dc:creator>
      <dc:date>2014-03-20T21:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196845#M56823</link>
      <description>&lt;P&gt;And the numbers at the end, they follow some pattern? like have dot "." at the end or always are 7-8 digits?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 21:26:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196845#M56823</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-20T21:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196846#M56824</link>
      <description>&lt;P&gt;I have both patterns unfortunately. &lt;BR /&gt;
Some ends with ".", some with just number. &lt;BR /&gt;
But these are the only possibilities with the number at the end of the line. &lt;BR /&gt;
All digits in the events are 8 digits.&lt;BR /&gt;
When you ask for it, I just realized that we may possibly get rid of all 8 digit numbers, right.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 21:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196846#M56824</guid>
      <dc:creator>axl88</dc:creator>
      <dc:date>2014-03-20T21:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196847#M56825</link>
      <description>&lt;P&gt;To get rid of a number at the end of an event at search time you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | rex mode=sed "s/\s*\d+(\.\d+)\s*$//"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That looks for a number, possibly with decimal places, and removes it along with surrounding whitespace if and only if the number is at the end of the event. You can restrict this to a specific field by specifying &lt;CODE&gt;field=name&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Note, your example event had an additional literal dot at the end of the event - if that's accurate you'll need to amend the regex like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;s/\s*\d+(\.\d+)\s*\.?$//
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Mar 2014 23:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196847#M56825</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-20T23:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196848#M56826</link>
      <description>&lt;P&gt;please read my question again with the comments.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 18:08:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196848#M56826</guid>
      <dc:creator>axl88</dc:creator>
      <dc:date>2014-03-21T18:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to take out numeric numbers at the end of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196849#M56827</link>
      <description>&lt;P&gt;I did. Now what?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2014 21:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-take-out-numeric-numbers-at-the-end-of-the-event/m-p/196849#M56827</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-21T21:02:21Z</dc:date>
    </item>
  </channel>
</rss>

