<?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: Modifying multi line event before indexing in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155759#M185714</link>
    <description>&lt;P&gt;Your REGEX line is not the same as mine.  The asterisks are critical.  If you want "position" to remain with the first event, try this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(.*position)(?=[^:])(.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Dec 2014 20:22:31 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2014-12-10T20:22:31Z</dc:date>
    <item>
      <title>Modifying multi line event before indexing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155756#M185711</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;i have an application that has an bug in the logging, but i need to workaround it. &lt;/P&gt;

&lt;P&gt;log structure:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Dec  10 13:21:09 abc: request:
Session: ******
User-Agent: ********
Content-Length:     ****
Content-Type: *********

positionDec  10 13:22:09 abc: reply:
Session: ********
Date: 2014-12-09T14:33:09Z
Range: *****
Scale: ****
Content-Type: ****
Content-Length: ***

position: ******
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this are two events. in the request event it writes at the and in the beginning of the replay message "position:"&lt;/P&gt;

&lt;P&gt;i tried already with seed to remove the "position:" - but it is valid in the replay event and it would remove this one as well. &lt;/P&gt;

&lt;P&gt;i guess i need to do it via transforms.conf as it needs to be done before we check for the timestamp, otherwise the full line will be used to the event to detect the timestamp. &lt;/P&gt;

&lt;P&gt;i tried to add via transforms a line break, but did not work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[position-fix]
REGEX = (?m)^(.*)position.*
FORMAT = $1\n position1$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks a lot for any advice.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 12:30:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155756#M185711</guid>
      <dc:creator>mmaier_splunk</dc:creator>
      <dc:date>2014-12-10T12:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying multi line event before indexing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155757#M185712</link>
      <description>&lt;P&gt;The following should remove the stray "position"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (.*)position(?=[^:])(.*)
FORMAT = $1\n$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Dec 2014 14:45:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155757#M185712</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-12-10T14:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying multi line event before indexing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155758#M185713</link>
      <description>&lt;P&gt;Hi richgalloway,&lt;/P&gt;

&lt;P&gt;your suggestion doesn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[abc_xyzprovider]
BREAK_ONLY_BEFORE = abc:
MAX_TIMESTAMP_LOOKAHEAD = 15
NO_BINARY_CHECK = 1
TIME_FORMAT = %b %d %H:%M:%S
TRANSFORMS-positionfix = position-fix
TZ = UTC
pulldown_type = 1 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[position-fix]
REGEX = (.)position(?=[^:])(.)
FORMAT = $1\n$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Still the "position" element (which belongs to the last event) is shown in the next event.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 19:37:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155758#M185713</guid>
      <dc:creator>lrudolph</dc:creator>
      <dc:date>2014-12-10T19:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying multi line event before indexing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155759#M185714</link>
      <description>&lt;P&gt;Your REGEX line is not the same as mine.  The asterisks are critical.  If you want "position" to remain with the first event, try this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(.*position)(?=[^:])(.*)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Dec 2014 20:22:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155759#M185714</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-12-10T20:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying multi line event before indexing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155760#M185715</link>
      <description>&lt;P&gt;Sorry, copy &amp;amp; paste must have missed something. But also with correct regex the result is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\nDec  9 14:33:09 abc: reply:
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sideeffect is also that everything that comes after this first line from the event is somehow deleted.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 07:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modifying-multi-line-event-before-indexing/m-p/155760#M185715</guid>
      <dc:creator>lrudolph</dc:creator>
      <dc:date>2014-12-11T07:02:16Z</dc:date>
    </item>
  </channel>
</rss>

