<?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 you parse multiline key value events? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418872#M73853</link>
    <description>&lt;P&gt;You want to change the appearance of the raw events, or you want to extract the fields? Based on your example, I'm assuming the first.&lt;/P&gt;

&lt;P&gt;Not entirely sure why you'd want to format the raw events, but something like this should work:&lt;/P&gt;

&lt;P&gt;in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SEDCMD-0split_to_lines = s/,\s/\n/g
SEDCMD-1strip_quotes = s/"//g
SEDCMD-2add_quotes = s/^([^\r\n]+)/"\1"/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example in the searchbar:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw = "2018-12-04 01:51:08.330, LogDate=\"2018-12-04 01:51:08.33\", SessionId=\"abc\", MachineName=\"xyz\", LoggerName=\"def\", LogLevel=\"DEBUG\", MessageId=\"DumpCacheNames\", Message=\"def\", ApplicationId=\"fgd\", EndpointStack=\"abc\", LogInsertDate=\"date\""
| rex mode=sed "s/, /\n/g"
| rex mode=sed "s/\"//g"
| rex mode=sed "s/^([^\r\n]+)/\"\1\"/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Dec 2018 08:21:13 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-12-04T08:21:13Z</dc:date>
    <item>
      <title>How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418868#M73849</link>
      <description>&lt;P&gt;How do you parse the below events?&lt;/P&gt;

&lt;P&gt;The events looks like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2018-12-04 01:51:08.330, LogDate="2018-12-04 01:51:08.33", SessionId="abc", MachineName="xyz", LoggerName="def", LogLevel="DEBUG", MessageId="DumpCacheNames", Message="def", ApplicationId="fgd", EndpointStack="abc", LogInsertDate="date"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to show events as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; "2018-12-04 01:51:08.330"
 SessionId=abc 
 MachineName=xyz 
 LoggerName=def
 LogLevel=DEBUG
 MessageId=DumpCacheNames
 Message=def
 ApplicationId=fgd
 EndpointStack=abc
 LogInsertDate=date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 07:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418868#M73849</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2018-12-04T07:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418869#M73850</link>
      <description>&lt;P&gt;Try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|kv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or in props.conf-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;KV_MODE = auto
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 07:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418869#M73850</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-12-04T07:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418870#M73851</link>
      <description>&lt;P&gt;Nup didn't work. Any other suggestion?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 08:02:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418870#M73851</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2018-12-04T08:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418871#M73852</link>
      <description>&lt;P&gt;i tried with sample data and it is working as expected&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval _raw="\"2018-12-04 01:51:08.330\"
  SessionId=abc 
  MachineName=xyz 
  LoggerName=def
  LogLevel=DEBUG
  MessageId=DumpCacheNames
  Message=def
  ApplicationId=fgd
  EndpointStack=abc
  LogInsertDate=date"| kv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 08:15:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418871#M73852</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-12-04T08:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418872#M73853</link>
      <description>&lt;P&gt;You want to change the appearance of the raw events, or you want to extract the fields? Based on your example, I'm assuming the first.&lt;/P&gt;

&lt;P&gt;Not entirely sure why you'd want to format the raw events, but something like this should work:&lt;/P&gt;

&lt;P&gt;in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
SEDCMD-0split_to_lines = s/,\s/\n/g
SEDCMD-1strip_quotes = s/"//g
SEDCMD-2add_quotes = s/^([^\r\n]+)/"\1"/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example in the searchbar:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw = "2018-12-04 01:51:08.330, LogDate=\"2018-12-04 01:51:08.33\", SessionId=\"abc\", MachineName=\"xyz\", LoggerName=\"def\", LogLevel=\"DEBUG\", MessageId=\"DumpCacheNames\", Message=\"def\", ApplicationId=\"fgd\", EndpointStack=\"abc\", LogInsertDate=\"date\""
| rex mode=sed "s/, /\n/g"
| rex mode=sed "s/\"//g"
| rex mode=sed "s/^([^\r\n]+)/\"\1\"/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 08:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418872#M73853</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-12-04T08:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418873#M73854</link>
      <description>&lt;P&gt;Try with this string &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2018-12-04 01:51:08.330, LogDate="2018-12-04 01:51:08.33", SessionId="abc", MachineName="xyz", LoggerName="def", LogLevel="DEBUG", MessageId="DumpCacheNames", Message="def", ApplicationId="fgd", EndpointStack="abc", LogInsertDate="date"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 09:51:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418873#M73854</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2018-12-04T09:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you parse multiline key value events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418874#M73855</link>
      <description>&lt;P&gt;@FrankVl &lt;BR /&gt;
Great Buddy. It worked. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want to change the appearance, it is already available in DB connect v1. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 10:09:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-parse-multiline-key-value-events/m-p/418874#M73855</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2018-12-04T10:09:01Z</dc:date>
    </item>
  </channel>
</rss>

