<?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 define event line-breaking in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341704#M101251</link>
    <description>&lt;P&gt;The recommended method here would to be fix your sourcetype definition (props.conf on indexer/heavy forwarder) to have proper line breaking and timestamp recognition of your events. (if possible delete and re-ingest the data). If you still want to do it from search try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search with field _raw | rex mode=sed "s/([\r\n]+)/##LF##/g" | makemv _raw delim="##LF##"
| mvexpand _raw | spath | eval _time=round(consumerTstamp/1000,3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 07 Mar 2017 17:53:01 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-03-07T17:53:01Z</dc:date>
    <item>
      <title>How do I define event line-breaking in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341701#M101248</link>
      <description>&lt;P&gt;Our Splunk forwarder is sending events that looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"consumerTstamp":1488853092650,"metric":"EvTot.byDomain","types":{"events":{}}}
{"consumerTstamp":1488853093650,"metric":"EvTot.byDomain","types":{"events":{}}}
{"consumerTstamp":1488853094650,"metric":"EvTot.byDomain","types":{"events":{}}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is obviously 3 events, but Splunk sees it as one.  I've been looking at how to get Splunk to separate on newline in a search, but have only found things about setting some property in the configuration.  How would I do this in a search?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341701#M101248</guid>
      <dc:creator>driekhof</dc:creator>
      <dc:date>2017-03-07T17:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I define event line-breaking in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341702#M101249</link>
      <description>&lt;P&gt;I did find a solution (I think) from searching other answers, it looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/mylog/my.log.0" | rex max_match=0 field=_raw "(?[^\n]+)" | mvexpand lineData | eval _raw=lineData | sort consumerTstamp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That works but seems a little verbose for something so basic.  Is there a better way?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341702#M101249</guid>
      <dc:creator>driekhof</dc:creator>
      <dc:date>2017-03-07T17:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I define event line-breaking in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341703#M101250</link>
      <description>&lt;P&gt;While the best practice is to fix the line breaking in props.conf, you can extract these three lines into a multivalued field using rex and then use mvexpand to seperate the events. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341703#M101250</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2017-03-07T17:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I define event line-breaking in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341704#M101251</link>
      <description>&lt;P&gt;The recommended method here would to be fix your sourcetype definition (props.conf on indexer/heavy forwarder) to have proper line breaking and timestamp recognition of your events. (if possible delete and re-ingest the data). If you still want to do it from search try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search with field _raw | rex mode=sed "s/([\r\n]+)/##LF##/g" | makemv _raw delim="##LF##"
| mvexpand _raw | spath | eval _time=round(consumerTstamp/1000,3)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-define-event-line-breaking-in-a-search/m-p/341704#M101251</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-07T17:53:01Z</dc:date>
    </item>
  </channel>
</rss>

