<?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 split multi-line events at search time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/599307#M208637</link>
    <description>&lt;P&gt;here's what I came up with.&amp;nbsp; seems to work pretty well without modifying the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw = "[abc] logline1
[def] logline 2
[ghi] logline 3"


| eval raw=_raw
| makemv tokenizer="(.*(\r\n|\r|\n|$))" raw
| mvexpand raw
| rename raw as _raw&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 25 May 2022 15:28:18 GMT</pubDate>
    <dc:creator>msquicc</dc:creator>
    <dc:date>2022-05-25T15:28:18Z</dc:date>
    <item>
      <title>How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375464#M110321</link>
      <description>&lt;P&gt;I have events that look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[abc] logline1
[def] logline 2
[ghi] logline 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I would like to split those events &lt;STRONG&gt;at search time&lt;/STRONG&gt; into 3 single line events.&lt;BR /&gt;
Is that possible?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;P.S.&lt;BR /&gt;
I Know this should be done at Indexer / Heavy Forwarder level using LINE_BREAKER, but that's not an option at this time.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375464#M110321</guid>
      <dc:creator>aa123s</dc:creator>
      <dc:date>2018-02-14T17:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375465#M110322</link>
      <description>&lt;P&gt;hello there,&lt;/P&gt;

&lt;P&gt;maybe try the &lt;CODE&gt;mvexpand&lt;/CODE&gt; command&lt;BR /&gt;
check i tout:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Mvexpand"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Mvexpand&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:49:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375465#M110322</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-02-14T17:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375466#M110323</link>
      <description>&lt;P&gt;Before posting I tried this:&lt;BR /&gt;
| rex mode=sed "s/([\r\n]+)/##LF##/g" | makemv _raw delim="##LF##" | mvexpand _raw&lt;/P&gt;

&lt;P&gt;but I couldn't make it work. Events are joined in a long string separated by ##LF##, but then those lines don't split back into separate events&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:14:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375466#M110323</guid>
      <dc:creator>aa123s</dc:creator>
      <dc:date>2018-02-14T19:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375467#M110324</link>
      <description>&lt;P&gt;Try like this. The mvexpand command doesn't seem to work with fields starting with underscore.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex mode=sed "s/([\r\n]+)/##LF##/g" | makemv _raw delim="##LF##" | rename _raw as raw | mvexpand raw | rename raw as _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375467#M110324</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-14T19:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375468#M110325</link>
      <description>&lt;P&gt;Referring to your previous question:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/618398/why-is-splunk-not-breaking-each-log-line-into-sing.html#answer-619402"&gt;https://answers.splunk.com/answers/618398/why-is-splunk-not-breaking-each-log-line-into-sing.html#answer-619402&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I strongly suggest working now to get these logs indexed properly instead of trying to solve this problem at search time.  You will end up being frustrated time and time again if your events are not indexed properly.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375468#M110325</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-14T19:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375469#M110326</link>
      <description>&lt;P&gt;Super! Its &lt;STRONG&gt;almost&lt;/STRONG&gt; working: the remaining problem is that lines are being re-grouped in reverse order... Could that be fixed? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375469#M110326</guid>
      <dc:creator>aa123s</dc:creator>
      <dc:date>2018-02-14T19:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375470#M110327</link>
      <description>&lt;P&gt;I got that, Thanks. We are already working to add correct indexing at forwarder level. In the mean time, however, we need this workaround.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375470#M110327</guid>
      <dc:creator>aa123s</dc:creator>
      <dc:date>2018-02-14T19:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375471#M110328</link>
      <description>&lt;P&gt;I'm sorry my comment was incomplete. I meant rows are being re-grouped in reverse order when I pipe the output of your solution to &lt;CODE&gt;transaction&lt;/CODE&gt; ...&lt;BR /&gt;
It normally doesn't happen&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375471#M110328</guid>
      <dc:creator>aa123s</dc:creator>
      <dc:date>2018-02-14T19:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375472#M110329</link>
      <description>&lt;P&gt;I ended up adding &lt;CODE&gt;| reverse&lt;/CODE&gt; at the end... go figure why that happens!...&lt;BR /&gt;
Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 20:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/375472#M110329</guid>
      <dc:creator>aa123s</dc:creator>
      <dc:date>2018-02-14T20:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multi-line events at search time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/599307#M208637</link>
      <description>&lt;P&gt;here's what I came up with.&amp;nbsp; seems to work pretty well without modifying the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw = "[abc] logline1
[def] logline 2
[ghi] logline 3"


| eval raw=_raw
| makemv tokenizer="(.*(\r\n|\r|\n|$))" raw
| mvexpand raw
| rename raw as _raw&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 25 May 2022 15:28:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multi-line-events-at-search-time/m-p/599307#M208637</guid>
      <dc:creator>msquicc</dc:creator>
      <dc:date>2022-05-25T15:28:18Z</dc:date>
    </item>
  </channel>
</rss>

