<?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 write the regex to extract the date fields and another key-value pair from my sample data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178665#M51393</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "*\s+(?P&amp;lt;Start_date&amp;gt;\S+)\s+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should give you the time value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?P&amp;lt;ROLLS&amp;gt;num_rows:\s+\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will get the ROLLS.&lt;/P&gt;

&lt;P&gt;But you would want &lt;CODE&gt;num_rows = 65931447&lt;/CODE&gt; right? for that.. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "num_rows:\s+(?P&amp;lt;num_rows&amp;gt;\d+)\,"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Didn't test these. Should be good though.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Mar 2015 17:34:58 GMT</pubDate>
    <dc:creator>theouhuios</dc:creator>
    <dc:date>2015-03-17T17:34:58Z</dc:date>
    <item>
      <title>How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178663#M51391</link>
      <description>&lt;P&gt;Hello guys, sup?&lt;/P&gt;

&lt;P&gt;We've got this piece of log which is a MySql log and we should not change the layout, but need to extract &lt;CODE&gt;START_DATE&lt;/CODE&gt;, &lt;CODE&gt;END_DATE&lt;/CODE&gt; and &lt;CODE&gt;NUM_ROWS&lt;/CODE&gt;.&lt;BR /&gt;
As follows a piece of data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;******************************************************
*****************  EXECUTION HYW   *****************
*****************    TRTD08IIL.SQL    *****************
******************************************************

***************   26/02/2015-07:00:06  ***************
Conectting to MYSQL

Execution Data
Process Code : TRTD08IIL
Program           : TRTD08IIL.SQL
Descripton          : Table
Critic      : E
Reference Date : 20140103

***************   26/02/2015-07:00:06  ***************
Temp Execution Path For File: /C:/TEMP/TRTD08IIL.SQL.TRTD08IIL

***************   26/02/2015-07:00:06  ***************
Temp Execution Path For File: /C:/TEMP/TRTD08IIL.SQL.TRTD08IIL

Table tb.User stats: [num_partitions: 0, num_files: 0, num_rows: 65931447, total_size: 0, raw_data_size: 15793929087]
65931447 Rows loaded to tab_clie
MapReduce Jobs Launched:
Job 0: Map: 18  Reduce: 4   Cumulative CPU: 608.98 sec   HDFS Read: 1037601634 HDFS Write: 604987045 SUCCESS
Job 1: Map: 59  Reduce: 58   Cumulative CPU: 4337.55 sec   HDFS Read: 14707612009 HDFS Write: 29413721 SUCCESS
Total MapReduce CPU Time Spent: 0 days 7 hours 59 minutes 42 seconds 920 msec
OK
Time taken: 2256.431 seconds


***************   26/02/2015-07:37:47  ***************
Temp Execution Path For File: /C:/TEMP/TRTD08IIL.SQL.TRTD08IIL

***************   26/02/2015-07:37:47  ***************
Temp Execution Path For File: /C:/TEMP/TRTD08IIL.SQL.TRTD08IIL
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2015 17:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178663#M51391</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-03-17T17:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178664#M51392</link>
      <description>&lt;P&gt;I need to extract by regex &lt;BR /&gt;
should be:&lt;/P&gt;

&lt;P&gt;START_DATE =  ***************   26/02/2015-07:00:06  ***************&lt;BR /&gt;
END_DATE =  ***************   26/02/2015-07:37:47  ***************&lt;BR /&gt;
ROLLS = num_rows: 65931447&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:10:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178664#M51392</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2020-09-28T19:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178665#M51393</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "*\s+(?P&amp;lt;Start_date&amp;gt;\S+)\s+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should give you the time value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?P&amp;lt;ROLLS&amp;gt;num_rows:\s+\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will get the ROLLS.&lt;/P&gt;

&lt;P&gt;But you would want &lt;CODE&gt;num_rows = 65931447&lt;/CODE&gt; right? for that.. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "num_rows:\s+(?P&amp;lt;num_rows&amp;gt;\d+)\,"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Didn't test these. Should be good though.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 17:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178665#M51393</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-03-17T17:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178666#M51394</link>
      <description>&lt;P&gt;Sorry about that. Been a while since I posted here. Looks like formatting got messed up.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 17:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178666#M51394</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2015-03-17T17:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178667#M51395</link>
      <description>&lt;P&gt;Is data already ingested and all these lines appear as one event?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 18:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178667#M51395</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-03-17T18:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178668#M51396</link>
      <description>&lt;P&gt;Yeah, max_event was applied with 10.000 in index preview...&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 18:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178668#M51396</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-03-17T18:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178669#M51397</link>
      <description>&lt;P&gt;This works on regex101.com:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"(?s)\*{15}\s+(?P&amp;lt;START_DATE&amp;gt;\d\d\/\d\d\/\d{4}-\d\d:\d\d:\d\d)\s+\*{15}.*\s(?P&amp;lt;NUM_ROWS&amp;gt;\d+)\sRows loaded.*Time taken: .*?seconds.*?\*{15}\s+(?&amp;lt;END_DATE&amp;gt;\d\d\/\d\d\/\d{4}-\d\d:\d\d:\d\d)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2015 19:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178669#M51397</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-03-17T19:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the regex to extract the date fields and another key-value pair from my sample data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178670#M51398</link>
      <description>&lt;P&gt;Thanks @richgalloway! Worked here!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2015 19:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-the-regex-to-extract-the-date-fields-and-another/m-p/178670#M51398</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-03-17T19:30:39Z</dc:date>
    </item>
  </channel>
</rss>

