<?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 Extracting multiline events into single line kv pairs. in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Extracting-multiline-events-into-single-line-kv-pairs/m-p/396178#M7759</link>
    <description>&lt;P&gt;So I have a script that we use to monitor our time drift on servers. The events look like this when ran: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server 10.0.1.187, stratum 4, offset 0.031839, delay 0.04155
server 10.0.1.188, stratum 5, offset -0.000584, delay 0.04158
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How should I configure my props.conf and transforms.conf so I have nice clean field extraction? &lt;/P&gt;

&lt;P&gt;So essentially each event is this but you may get 2-3 events per run of the script: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;key value, key value, key value, key value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Update: I decided I was okay with search time extraction based on reading the props.conf documentation recommending this and so I have the following search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;basesearch | rex field=_raw "server (?&amp;lt;server&amp;gt;.*), stratum (?&amp;lt;stratum&amp;gt;.*), offset (?&amp;lt;offset&amp;gt;.*), delay (?&amp;lt;delay&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which is fine if I only have one event but for multiline events it ignores all events after the first. How should I change this regex?&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 21:59:56 GMT</pubDate>
    <dc:creator>JordanPeterson</dc:creator>
    <dc:date>2018-05-10T21:59:56Z</dc:date>
    <item>
      <title>Extracting multiline events into single line kv pairs.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Extracting-multiline-events-into-single-line-kv-pairs/m-p/396178#M7759</link>
      <description>&lt;P&gt;So I have a script that we use to monitor our time drift on servers. The events look like this when ran: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server 10.0.1.187, stratum 4, offset 0.031839, delay 0.04155
server 10.0.1.188, stratum 5, offset -0.000584, delay 0.04158
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How should I configure my props.conf and transforms.conf so I have nice clean field extraction? &lt;/P&gt;

&lt;P&gt;So essentially each event is this but you may get 2-3 events per run of the script: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;key value, key value, key value, key value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Update: I decided I was okay with search time extraction based on reading the props.conf documentation recommending this and so I have the following search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;basesearch | rex field=_raw "server (?&amp;lt;server&amp;gt;.*), stratum (?&amp;lt;stratum&amp;gt;.*), offset (?&amp;lt;offset&amp;gt;.*), delay (?&amp;lt;delay&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which is fine if I only have one event but for multiline events it ignores all events after the first. How should I change this regex?&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 21:59:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Extracting-multiline-events-into-single-line-kv-pairs/m-p/396178#M7759</guid>
      <dc:creator>JordanPeterson</dc:creator>
      <dc:date>2018-05-10T21:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiline events into single line kv pairs.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Extracting-multiline-events-into-single-line-kv-pairs/m-p/396179#M7760</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;this regex should match those kind of events pretty well:&lt;BR /&gt;
&lt;CODE&gt;\s?([^\s,]+)\s([^\s,]+)(?:,|$)&lt;/CODE&gt;&lt;BR /&gt;
&lt;A href="https://regex101.com/r/JcFf16/1/"&gt;regex101.com link&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You could then create a stanza in props.conf for your sourcetype/host/source to match, and have it include:&lt;BR /&gt;
&lt;CODE&gt;REPORT-ntpevents = ntpevents&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then have transforms.conf like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ntpevents]
REGEX = \s?([^\s,]+)\s([^\s,]+)(?:,|$)
MV_ADD = true
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 22:14:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Extracting-multiline-events-into-single-line-kv-pairs/m-p/396179#M7760</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-10T22:14:03Z</dc:date>
    </item>
  </channel>
</rss>

