<?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 make splunk interpret multiple lines as single line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109088#M28454</link>
    <description>&lt;P&gt;You might want to experiment with the SHOULD_LINEMERGE. If you want to use the LINE_BREAKER then you need to add the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Sep 2020 10:06:31 GMT</pubDate>
    <dc:creator>tgow</dc:creator>
    <dc:date>2020-09-28T10:06:31Z</dc:date>
    <item>
      <title>How to make splunk interpret multiple lines as single line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109086#M28452</link>
      <description>&lt;P&gt;I have a pretty long log that needs to be analyzed, not single lined though, here is example #1:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.....some unimportant data many lines...
2011-11-07 13:05:48,060 INFO com.mysoftware.log.splunk.test.Processor: loadStatus = NEW
2011-11-07 13:05:47,984 INFO com.mysoftware.log.splunk.test.Processor: DELTA status determined for record with ID: 010bbd25aeccaacb564fab543c5b0429083c804a 
2011-11-07 13:05:47,984 INFO com.mysoftware.log.splunk.test.Processor: DELTA status: ID=bebbe8570c4ce87238378b53241a976a5528dfaf, {TEST:DELTA_STATUS=NEW, TEST:JOB_ID=job_201110281559_2009, TEST:LAST_UPDATED_TIMESTAMP=Mon, 7 Nov 2011 13:05:47, TEST:ROW_ID=010bbd25aeccaacb564fab543c5b0429083c804a, TEST:LOAD_JOB_ID=job_201110281559_2008} 
2011-11-07 13:05:48,060 INFO com.mysoftware.log.splunk.test.Processor: loadStatus = NEW
2011-11-07 13:05:48,060 INFO com.mysoftware.log.splunk.test.Processor: DELTA status determined for record with ID: 0141daa46fa7a576b538d2437a339f8ad041f0b7 
2011-11-07 13:05:48,060 INFO com.mysoftware.log.splunk.test.Processor: DELTA status: ID=ecaf46341bb7c040ece713e87f0308308093838c, {TEST:DELTA_STATUS=NEW, TEST:JOB_ID=job_201110281559_2009, TEST:LAST_UPDATED_TIMESTAMP=Mon, 7 Nov 2011 13:05:48, TEST:ROW_ID=0141daa46fa7a576b538d2437a339f8ad041f0b7, TEST:LOAD_JOB_ID=job_201110281559_2008} 
2011-11-07 13:05:48,130 INFO com.mysoftware.log.splunk.test.Processor: loadStatus = NEW
2011-11-07 13:05:48,130 INFO com.mysoftware.log.splunk.test.Processor: DELTA status determined for record with ID: 01b9bba9474f3c838931242883a7462722fb45b1 
2011-11-07 13:05:48,130 INFO com.mysoftware.log.splunk.test.Processor: DELTA status: ID=c9711472457d8f4b226c75da5a9ce2cfee099680, {TEST:DELTA_STATUS=NEW, TEST:JOB_ID=job_201110281559_2009, TEST:LAST_UPDATED_TIMESTAMP=Mon, 7 Nov 2011 13:05:48, TEST:ROW_ID=01b9bba9474f3c838931242883a7462722fb45b1, TEST:LOAD_JOB_ID=job_201110281559_2008} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is example of how one line/record should look like, example #2:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2011-11-07 13:05:48,060 INFO com.mysoftware.log.splunk.test.Processor: loadStatus = NEW
2011-11-07 13:05:47,984 INFO com.mysoftware.log.splunk.test.Processor: DELTA status determined for record with ID: 010bbd25aeccaacb564fab543c5b0429083c804a 
2011-11-07 13:05:47,984 INFO com.mysoftware.log.splunk.test.Processor: DELTA status: ID=bebbe8570c4ce87238378b53241a976a5528dfaf, {TEST:DELTA_STATUS=NEW, TEST:JOB_ID=job_201110281559_2009, TEST:LAST_UPDATED_TIMESTAMP=Mon, 7 Nov 2011 13:05:47, TEST:ROW_ID=010bbd25aeccaacb564fab543c5b0429083c804a, TEST:LOAD_JOB_ID=job_201110281559_2008} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So this example #1 should be read as 3 records(3 lines), not multiple lines as usual. I went trough some splunk documents realized that I need to add a new source type and define line breaking for myself. &lt;/P&gt;

&lt;P&gt;And in my etc/system/local added props.conf and inside defined new source type and added &lt;CODE&gt;}&lt;/CODE&gt; as a LINE_BREAKER but it's not working it seems that it breaks my line by default when it sees the timestamp. How do I do this? How do I make splunk treat these 3 separate lines as one?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 10:11:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109086#M28452</guid>
      <dc:creator>c0mrade</dc:creator>
      <dc:date>2011-11-15T10:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to make splunk interpret multiple lines as single line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109087#M28453</link>
      <description>&lt;P&gt;I think that would be very hard to do, since there is nothing in the separate lines of an 'event' that bind them together, not even the time stamps (if I understand you correctly.)&lt;/P&gt;

&lt;P&gt;Your best bet is probably to use the &lt;CODE&gt;transaction&lt;/CODE&gt; command in a rather inefficient manner, if the first line to be considered part of the event contains "loadStatus = NEW" and the last line contains the the string "DELTA staus:" (note the comma). &lt;/P&gt;

&lt;P&gt;In order for &lt;CODE&gt;transaction&lt;/CODE&gt; to work, the lines need to be 'grouped' on a common piece of information. Since there are no ID values that are common to the event, you'll have to find one an make sure it won't change. &lt;/P&gt;

&lt;P&gt;Given the example log you provided, you can extract the log level, e.g. INFO, or the "com.mysoftware..." string and run the transaction on that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction log_level startswith="loadStatus = NEW" endswith="DELTA status:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note that this will (partly) fail if:&lt;BR /&gt;
a) log lines are not written sequentially, and only one 'event' at a time.&lt;BR /&gt;
b) 'events' do contain alternate values for the transaction 'group-by' variable&lt;/P&gt;

&lt;P&gt;For more information on the &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.3/SearchReference/Transaction"&gt;transaction&lt;/A&gt; command, see the docs.&lt;/P&gt;

&lt;P&gt;Ideally, you should have the logging software write a transaction ID which would make this whole operation much simpler.&lt;/P&gt;

&lt;P&gt;UPDATE:  if you just want to break the lines after the '}' you could always edit your props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = }([\r\n]+)
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, this still requires that the lines are written sequentially, one 'event' at a time.&lt;/P&gt;

&lt;P&gt;hope this helps,&lt;/P&gt;

&lt;P&gt;kristian&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 10:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109087#M28453</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-11-15T10:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to make splunk interpret multiple lines as single line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109088#M28454</link>
      <description>&lt;P&gt;You might want to experiment with the SHOULD_LINEMERGE. If you want to use the LINE_BREAKER then you need to add the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SHOULD_LINEMERGE = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-splunk-interpret-multiple-lines-as-single-line/m-p/109088#M28454</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2020-09-28T10:06:31Z</dc:date>
    </item>
  </channel>
</rss>

