<?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: Log file monitoring, wrong parsing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288865#M55173</link>
    <description>&lt;P&gt;Glad it works now. Please mark my answer as accepted for posterity. Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2017 15:50:37 GMT</pubDate>
    <dc:creator>s2_splunk</dc:creator>
    <dc:date>2017-08-25T15:50:37Z</dc:date>
    <item>
      <title>Log file monitoring, wrong parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288861#M55169</link>
      <description>&lt;P&gt;Hy guys,&lt;BR /&gt;
I've a nodejs application which is logging in a text file in JSON format using the &lt;A href="https://github.com/winstonjs/winston"&gt;winston&lt;/A&gt; library.&lt;/P&gt;

&lt;P&gt;As you can see from the image, not all log lines are well parsed:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3384i2CD395952CBA013A/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;There are 2 logs line that are treated as one, and as a result, splunk is not able to detect the fields in the log lines (level, message ....)&lt;/P&gt;

&lt;P&gt;This is my configuration:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///home/user/myapp/log]
disabled = false
index = myindex
crcSalt = &amp;lt;SOURCE&amp;gt;
sourcetype = json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this is my log file:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3385i32C8D52FF6F05BCB/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 09:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288861#M55169</guid>
      <dc:creator>faustf</dc:creator>
      <dc:date>2017-08-24T09:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Log file monitoring, wrong parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288862#M55170</link>
      <description>&lt;P&gt;I would recommend taking a sample of your data and brining it in through the GUI.  When you do this, you can tweak the Breaking, Timestamping, etc... and see how it effects the way the data will be ingested.  You can use the BREAK_ONLY_BEFORE parameter to apply a regex that identifies the beginning of each event.  &lt;/P&gt;

&lt;P&gt;Something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE       \{\"\w+\":
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Once you get the linebreaking correct, save the sourcetype and then start feeding your data in through a forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:25:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288862#M55170</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2020-09-29T15:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Log file monitoring, wrong parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288863#M55171</link>
      <description>&lt;P&gt;Share your sourcetype definition for "json" in props.conf, please.&lt;BR /&gt;
If you intended to use the built-in sourcetype for json data, that would be "_json".&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 17:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288863#M55171</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-08-24T17:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Log file monitoring, wrong parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288864#M55172</link>
      <description>&lt;P&gt;Thank you for your answer, but the problem was that the sourcetype was wrong: I wrote json instead o _json, as @ssievert  wrote.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 07:35:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288864#M55172</guid>
      <dc:creator>faustf</dc:creator>
      <dc:date>2017-08-25T07:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Log file monitoring, wrong parsing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288865#M55173</link>
      <description>&lt;P&gt;Glad it works now. Please mark my answer as accepted for posterity. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 15:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-file-monitoring-wrong-parsing/m-p/288865#M55173</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-08-25T15:50:37Z</dc:date>
    </item>
  </channel>
</rss>

