<?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: Using regex on Extracted field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480851#M134741</link>
    <description>&lt;P&gt;@373782073 is the above example the backup file name bkp_filename from which you need to extract date?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 01:31:25 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-01-09T01:31:25Z</dc:date>
    <item>
      <title>Using regex on Extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480850#M134740</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have incoming syslog events for which I've used the Field Extraction wizard in SPLUNK to separate a the filename of the events which results in the field values look like this:&lt;/P&gt;

&lt;P&gt;abc-servicen.City-backup-&lt;STRONG&gt;1986-01-08&lt;/STRONG&gt;-16:00:43-level1.tar&lt;/P&gt;

&lt;P&gt;I would like to eventually extract and tabulate the filename (I've called it &lt;STRONG&gt;bkp_filename&lt;/STRONG&gt; when I extracted this field earlier) as well as the date YYYY-MM-DD for each filename in a separate field (call it &lt;STRONG&gt;bkp_file_date&lt;/STRONG&gt;).&lt;/P&gt;

&lt;P&gt;Can anyone suggest how to use regex or an in-built function to achieve the date extraction into a separate field or column?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480850#M134740</guid>
      <dc:creator>373782073</dc:creator>
      <dc:date>2020-09-30T03:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex on Extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480851#M134741</link>
      <description>&lt;P&gt;@373782073 is the above example the backup file name bkp_filename from which you need to extract date?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 01:31:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480851#M134741</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-01-09T01:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex on Extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480852#M134742</link>
      <description>&lt;P&gt;Hi 373782073,&lt;/P&gt;

&lt;P&gt;Give this a try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval example="abc-servicen.City-backup-1986-01-08-16:00:43-level1.tar" 
| rex field=example "(?&amp;lt;bkp_filename&amp;gt;[a-zA-Z-\.]+)-(?&amp;lt;bkp_file_date&amp;gt;\d{4}-\d{2}-\d{2})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 01:32:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480852#M134742</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-01-09T01:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex on Extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480853#M134743</link>
      <description>&lt;P&gt;Yes this is the field extracted which has the date embedded&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 01:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480853#M134743</guid>
      <dc:creator>373782073</dc:creator>
      <dc:date>2020-01-09T01:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex on Extracted field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480854#M134744</link>
      <description>&lt;P&gt;Great. I was able to add the rex statement to my existing search and strip the info I wanted into separate fields. &lt;BR /&gt;
Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 01:46:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-on-Extracted-field/m-p/480854#M134744</guid>
      <dc:creator>373782073</dc:creator>
      <dc:date>2020-01-09T01:46:53Z</dc:date>
    </item>
  </channel>
</rss>

