<?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 remove a few characters at the beginning of a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429532#M172511</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourquery|rex field=msg "_\d{3}(?P&amp;lt;date&amp;gt;\d{4}.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourquery|rex field=msg "\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Mar 2019 14:42:17 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-03-12T14:42:17Z</dc:date>
    <item>
      <title>How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429528#M172507</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I have the following field values and i want extract only the highlighted values  from it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;utility_extract10_DELTA_708**2019-03-12 06:03:33**
utility_extract1_DELTA_708**2019-03-12 06:06:27**
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please give me a solution to this?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429528#M172507</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-03-12T14:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429529#M172508</link>
      <description>&lt;P&gt;Can you specify the required text&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429529#M172508</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-12T14:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429530#M172509</link>
      <description>&lt;P&gt;2019-03-12 06:03:33&lt;BR /&gt;
2019-03-12 06:06:27&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429530#M172509</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-03-12T14:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429531#M172510</link>
      <description>&lt;P&gt;actual field values are like below&lt;/P&gt;

&lt;P&gt;utility_extract10_DELTA_7082019-03-12 06:03:33&lt;BR /&gt;
utility_extract1_DELTA_7082019-03-12 06:06:27&lt;/P&gt;

&lt;P&gt;i want to extract &lt;/P&gt;

&lt;P&gt;2019-03-12 06:03:33&lt;BR /&gt;
2019-03-12 06:06:27 respectively&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429531#M172510</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429532#M172511</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourquery|rex field=msg "_\d{3}(?P&amp;lt;date&amp;gt;\d{4}.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourquery|rex field=msg "\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429532#M172511</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-12T14:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429533#M172512</link>
      <description>&lt;P&gt;no this is not working for all the values...i have 22 values for msg field before apply this rex, but after i apply its showing only 20 values...for 2 values the regex is not appropriate..&lt;/P&gt;

&lt;P&gt;Posting here few more values from that value&lt;/P&gt;

&lt;P&gt;utility_extract10_DELTA_7082019-03-12 06:03:33&lt;BR /&gt;
utility_extract10_DELTA_9362019-03-12 06:07:00&lt;BR /&gt;
utility_extract11_DELTA_7082019-03-12 06:08:17&lt;BR /&gt;
utility_extract11_DELTA_9362019-03-12 06:07:35&lt;BR /&gt;
utility_extract12_DELTA_7082019-03-12 06:08:39&lt;BR /&gt;
utility_extract13_DELTA_7082019-03-12 06:08:40&lt;BR /&gt;
utility_extract13_DELTA_9362019-03-12 06:10:21&lt;BR /&gt;
utility_extract14_DELTA_7082019-03-12 06:09:52&lt;BR /&gt;
utility_extract1_DELTA_7082019-03-12 06:06:27&lt;BR /&gt;
utility_extract1_DELTA_9362019-03-12 06:06:51&lt;/P&gt;

&lt;P&gt;i just neeed to extract the date and time from that field&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:37:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429533#M172512</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429534#M172513</link>
      <description>&lt;P&gt;@pench2k19 You can use the below rex command , suppose your field name is x&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;your query&amp;gt;|rex field=x "_\d+.*(?P&amp;lt;date&amp;gt;\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429534#M172513</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-03-12T14:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429535#M172514</link>
      <description>&lt;P&gt;no luck..its still missing 2 values before and after we apply rex expression&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429535#M172514</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2019-03-12T15:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429536#M172515</link>
      <description>&lt;P&gt;hi @pench2k19 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   |rex  "\*?(?P&amp;lt;my_time&amp;gt;\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})\*?" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you a new field called 'my_time' with just your extracted date.&lt;/P&gt;

&lt;P&gt;This should work, given your source data: see &lt;A href="https://regex101.com/r/hZQsA9/2"&gt;https://regex101.com/r/hZQsA9/2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429536#M172515</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-12T15:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429537#M172516</link>
      <description>&lt;P&gt;no luck with this as well.&lt;/P&gt;

&lt;P&gt;as i said in my previous comments i have 22 values like  the follwoing in one field&lt;/P&gt;

&lt;P&gt;utility_extract10_DELTA_7082019-03-12 06:03:33&lt;BR /&gt;
utility_extract10_DELTA_9362019-03-12 06:07:00&lt;BR /&gt;
utility_extract11_DELTA_7082019-03-12 06:08:17&lt;BR /&gt;
utility_extract11_DELTA_9362019-03-12 06:07:35&lt;BR /&gt;
utility_extract12_DELTA_7082019-03-12 06:08:39&lt;BR /&gt;
utility_extract13_DELTA_7082019-03-12 06:08:40&lt;BR /&gt;
utility_extract13_DELTA_9362019-03-12 06:10:21&lt;BR /&gt;
utility_extract14_DELTA_7082019-03-12 06:09:52&lt;BR /&gt;
utility_extract1_DELTA_7082019-03-12 06:06:27&lt;BR /&gt;
utility_extract1_DELTA_9362019-03-12 06:06:51&lt;/P&gt;

&lt;P&gt;but after i apply above regex it is giving me only 20 values result in the output, 2 values are missing&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429537#M172516</guid>
      <dc:creator>pench2k19</dc:creator>
      <dc:date>2020-09-29T23:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429538#M172517</link>
      <description>&lt;P&gt;@pench2k19 Are you sure, I tried the below query and it resulted in appropriate date/time value in date field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval x="utility_extract10_DELTA_708*2019-03-12 06:03:33"| appendpipe[|eval x="utility_extract1_DELTA_7082019-03-12 06:06:27*"]|rex field=x "_\d+.*(?P&amp;lt;date&amp;gt;\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:17:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429538#M172517</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-03-12T15:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429539#M172518</link>
      <description>&lt;P&gt;If possible can you please post that two msg that was missing&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429539#M172518</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-12T15:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429540#M172519</link>
      <description>&lt;P&gt;try this rex &lt;CODE&gt;_.+(?P&amp;lt;date&amp;gt;\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429540#M172519</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-12T15:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a few characters at the beginning of a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429541#M172520</link>
      <description>&lt;P&gt;Have you tried?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 16:28:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-few-characters-at-the-beginning-of-a-field/m-p/429541#M172520</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-12T16:28:19Z</dc:date>
    </item>
  </channel>
</rss>

