<?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 do I get REGEX to extract multiple values from an event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237098#M70464</link>
    <description>&lt;P&gt;I tried this, though it didn't seem to work. When I say this, I mean the 'rex' format you mentioned above. I didn't adjust this in the props. &lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2015 16:11:01 GMT</pubDate>
    <dc:creator>tmarlette</dc:creator>
    <dc:date>2015-11-17T16:11:01Z</dc:date>
    <item>
      <title>How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237094#M70460</link>
      <description>&lt;P&gt;I have a long, that gets pretty long, and currently splunk is ingesting it as a whole. this log gets up a couple hundred lines long, and there are multiple events within this log that I need to extract. I am currently using REGEX to do the extraction, but it is only pulling the most recent instance of the extraction and not extracting the other instances within the log. &lt;/P&gt;

&lt;P&gt;For example, here is my extraction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOTE:\sPROCEDURE\s(?&amp;lt;procedure&amp;gt;\w+)\sused
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And here is the log file that I am consuming. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NOTE: Deleting WORK.CONTENTS (memtype=DATA).
    NOTE: PROCEDURE DATASETS used (Total process time):
          real time           0.00 seconds
          cpu time            0.01 seconds

    MACROGEN(CONTENTS_CNTR):   data _null_ ;
    MACROGEN(CONTENTS_CNTR):   file "/idn/wsmis/SDPMON_Raw/Logs/SDPMONRaw_Job45_error_log_FDT20150423_RD20151116.txt" mod ;
    MACROGEN(CONTENTS_CNTR):   put "*** value for list_of_files cnt/freq:" @80 "8" @93 "***;";

ommiting 197 lines...
    NOTE: PROCEDURE CONTENTS used (Total process time):
          real time           0.00 seconds
          cpu time            0.00 seconds

    MACROGEN(CONTENTS_CNTR):   data _null_ ;
    MACROGEN(CONTENTS_CNTR):   set contents ;
    MACROGEN(CONTENTS_CNTR):   if _n_ = 1 ;
    MACROGEN(CONTENTS_CNTR):   call symput('no_obs',strip(put(NOBS,comma12.)));
    MACROGEN(CONTENTS_CNTR):   call symput('desc',"list_of_files_last");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this example you can clearly see there there are two &lt;CODE&gt;PROCEDURES&lt;/CODE&gt; the first is called &lt;CODE&gt;DATASETS&lt;/CODE&gt; and the next is called &lt;CODE&gt;CONTENTS&lt;/CODE&gt;. &lt;BR /&gt;
My extraction is only pulling out the DATASETS value, and then not pulling out the other. Should I be adding a setting to my sourcetype to allow for multiple values here?  &lt;/P&gt;

&lt;P&gt;Adding the search / index time extractions as requested:&lt;/P&gt;

&lt;P&gt;search time settings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EXTRACT-rT_cpUT = The SAS System used:\s+real\s+time\s+(?&amp;lt;totalRealTime&amp;gt;[^s]+)[^.*]+cpu\stime\s+(?&amp;lt;totalCPUTime&amp;gt;[^s]+)\s+
EVAL-totalCPUTime = replace(totalCPUTime, "^(\d{2})\.(\d{2})","00:00:\1.\2")
EXTRACT-proc = NOTE:\sPROCEDURE\s(?&amp;lt;procedure&amp;gt;\w+)\sused
EXTRACT-logFile = \/idn\/saslogs\/Altlogs_Linux\/(?&amp;lt;fileDate&amp;gt;\d+)\/(?&amp;lt;user&amp;gt;[^-]+)-(?&amp;lt;version&amp;gt;[^-]+)-\d+-(?&amp;lt;startTime&amp;gt;\d+)-PID(?&amp;lt;pid&amp;gt;\d+) in source
EXTRACT-logFile2 = \/idn\/saslogs\/Altlogs\/(?&amp;lt;fileDate&amp;gt;\d+)\/(?&amp;lt;user&amp;gt;[^-]+)-(?&amp;lt;version&amp;gt;[^-]+)-\d+-(?&amp;lt;startTime&amp;gt;\d+)-PID(?&amp;lt;pid&amp;gt;\d+) in source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;index time settings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NO_BINARY_CHECK=1
LINE_BREAKER = ((*FAIL))
SHOULD_LINEMERGE = false
TRUNCATE = 9999999
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you for any help!!  &lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 20:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237094#M70460</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2015-11-16T20:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237095#M70461</link>
      <description>&lt;P&gt;Please provide the entire props.conf stanza for this sourcetype, if you're doing an index-time extraction.&lt;BR /&gt;
If you're doing a search-time extraction, please provide the search.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 20:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237095#M70461</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-16T20:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237096#M70462</link>
      <description>&lt;P&gt;You need to add &lt;CODE&gt;MV_ADD = 1&lt;/CODE&gt; to the appropriate stanza in &lt;CODE&gt;transforms.conf&lt;/CODE&gt;.  This does the same thing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...  | rex max_match=0 "NOTE:\sPROCEDURE\s(?&amp;lt;procedure&amp;gt;\w+)\sused"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2015 21:50:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237096#M70462</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-16T21:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237097#M70463</link>
      <description>&lt;P&gt;I try this and success.&lt;/P&gt;

&lt;P&gt;config on props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[testmv_add] =&amp;gt; this is the sourcetype
SHOULD_LINEMERGE = true
REPORT-testmv_add = mv_addreport
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;config on transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mv_addreport]
REGEX=PROCEDURE\s([^\s]+)
FORMAT = ProcedureName::$1
MV_ADD=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/829iFE82BA73A180017D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 09:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237097#M70463</guid>
      <dc:creator>yulianaif</dc:creator>
      <dc:date>2015-11-17T09:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237098#M70464</link>
      <description>&lt;P&gt;I tried this, though it didn't seem to work. When I say this, I mean the 'rex' format you mentioned above. I didn't adjust this in the props. &lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:11:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237098#M70464</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2015-11-17T16:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237099#M70465</link>
      <description>&lt;P&gt;You will need to add &lt;CODE&gt;MV_ADD=1&lt;/CODE&gt; to props.conf for the file to work correctly.  Then you will have to use mv*commands to process the multi-valued 'procedure' variable.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 13:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237099#M70465</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-18T13:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237100#M70466</link>
      <description>&lt;P&gt;Why don't you use the LINE_BREAKER expression to properly break your events (And what are you trying to archieve with &lt;CODE&gt;LINE_BREAKER = ((*FAIL))&lt;/CODE&gt; help here)? &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/Data/Indexmulti-lineevents#Line_breaking_general_attributes" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/Data/Indexmulti-lineevents#Line_breaking_general_attributes&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Admin/Propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Admin/Propsconf&lt;/A&gt; (search for "LINE_BREAKER")&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:55:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237100#M70466</guid>
      <dc:creator>Sebastian2</dc:creator>
      <dc:date>2020-09-29T07:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237101#M70467</link>
      <description>&lt;P&gt;unfortunatley, the logs are not clean enough to use a line breaker. Event start/stop is not clearly delineated. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 15:54:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237101#M70467</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2015-11-18T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get REGEX to extract multiple values from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237102#M70468</link>
      <description>&lt;P&gt;Did you read the props.conf documentation carefully? There are a &lt;STRONG&gt;bunch&lt;/STRONG&gt; of possibilities to break events (not only the &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;/edit I cut that out again, way too much ugly formatted text. Search for LINE_BREAKER, there are several pages regarding event breaking. &lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 16:09:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-REGEX-to-extract-multiple-values-from-an-event/m-p/237102#M70468</guid>
      <dc:creator>Sebastian2</dc:creator>
      <dc:date>2015-11-18T16:09:03Z</dc:date>
    </item>
  </channel>
</rss>

