<?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 extract multiple values from a log into one field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193734#M55832</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;...| rex field=_raw max_match=0 "--- (?&amp;lt;usr&amp;gt;\w+) ---" | rex field=_raw max_match=0 " (?&amp;lt;commit&amp;gt;[D,A,U]) (?&amp;lt;file&amp;gt;[\w\/]+)" | fields _raw,usr,commit,file
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should work.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2015 01:56:37 GMT</pubDate>
    <dc:creator>ramdaspr</dc:creator>
    <dc:date>2015-08-27T01:56:37Z</dc:date>
    <item>
      <title>How do I extract multiple values from a log into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193733#M55831</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I've been struggling for a few days to extract logs from our SVN repository.&lt;/P&gt;

&lt;P&gt;Each event contains a list of files that have been modified.&lt;BR /&gt;
I would like to extract those files and make statistics with them.&lt;/P&gt;

&lt;P&gt;Let's start simple and let's just try to extract them with a regular expression.&lt;BR /&gt;
Here are 3 example events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Wed Jul 29 10:05:37 CEST 2015 --- x3000 --- D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/banche/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/cadran/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/cadran_carta/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/amacvret/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/dm_ctrl_metod/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/dm_rischio/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/piani/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/ricerca/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/universo_recupero/ D BATCH/BRANCHES/PROD/RESBOU/file_load/load_universi/mensile/veicoli/ --- Dismissione script per mondo nero, nacrad, Amacreoi, Controllo Metodologico, DM_RISCHIO, Piani, Ricerca, Recovert and cars

Wed Jul 29 10:11:27 CEST 2015 --- Z1567 --- D BUSINESSOBJECTS/BRANCHES/PROD/nero.unv D BUSINESSOBJECTS/BRANCHES/PROD/nadrac.unv D BUSINESSOBJECTS/BRANCHES/PROD/Controllo Metodologico.unv D BUSINESSOBJECTS/BRANCHES/PROD/ramaCrdit.unv D BUSINESSOBJECTS/BRANCHES/PROD/DM_RISCHIO.unv D BUSINESSOBJECTS/BRANCHES/PROD/Piani.unv D BUSINESSOBJECTS/BRANCHES/PROD/Ricerca.unv D BUSINESSOBJECTS/BRANCHES/PROD/cars.unv D BUSINESSOBJECTS/BRANCHES/PROD/uni_rec.unv --- Dismissione mondo nero, nadrac, ramaCrdit, Controllo Metodologico, DM_RISCHIO, Piani, Ricerca, Recovert univers and cars

Thu Jul 30 17:07:02 CEST 2015 --- X1254 --- U BUSINESSOBJECTS/TRUNK/Analisy_Mapping.unv --- Progetto ITXDE1506 - Mapping
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the regular expression I have used to first extract the ID of the person who did the commit and the list of files:&lt;/P&gt;

&lt;P&gt;sourcetype=svn  source="script-svn_log" | rex max_match=0 ---(?&amp;lt;&lt;STRONG&gt;userID&lt;/STRONG&gt;&amp;gt;.&lt;EM&gt;)---(?&amp;lt;&lt;/EM&gt;&lt;EM&gt;Commit&lt;/EM&gt;&lt;EM&gt;&amp;gt;.&lt;/EM&gt;)---&lt;/P&gt;

&lt;P&gt;Now I would like to extract within the &lt;STRONG&gt;Commit&lt;/STRONG&gt; field all the files and the action that has been done to the file (the action is represented either by a capital letter D, A or a U).&lt;/P&gt;

&lt;P&gt;First question: Is it possible to apply a regular expression that returns multiple values to only one field?&lt;/P&gt;

&lt;P&gt;Second question: For each result, will it be possible to generate fake/dummy events? Each event will contain all the previous fields + the name of the file + the nature of the commit (A or D or U)  &lt;/P&gt;

&lt;P&gt;Thank you for your time.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193733#M55831</guid>
      <dc:creator>michwii</dc:creator>
      <dc:date>2020-09-29T07:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple values from a log into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193734#M55832</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;...| rex field=_raw max_match=0 "--- (?&amp;lt;usr&amp;gt;\w+) ---" | rex field=_raw max_match=0 " (?&amp;lt;commit&amp;gt;[D,A,U]) (?&amp;lt;file&amp;gt;[\w\/]+)" | fields _raw,usr,commit,file
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should work.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 01:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193734#M55832</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-08-27T01:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract multiple values from a log into one field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193735#M55833</link>
      <description>&lt;P&gt;Isn't this question same as your other question?&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/302497/extract-fields-with-multiple-results-or-generate-f.html"&gt;http://answers.splunk.com/answers/302497/extract-fields-with-multiple-results-or-generate-f.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 03:10:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-multiple-values-from-a-log-into-one-field/m-p/193735#M55833</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-27T03:10:08Z</dc:date>
    </item>
  </channel>
</rss>

