<?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: should_linemerge for json data using universal forwarder in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151974#M30931</link>
    <description>&lt;P&gt;Generally what you do, if you are not using somebody else's configuration files (e.g. from an app on apps.splunk.com), is you create your own app directory like &lt;CODE&gt;$SPLUNK_HOME/etc/apps/MyApp/default&lt;/CODE&gt; (yes, since you are the developer of this app, you use &lt;CODE&gt;default&lt;/CODE&gt;, not &lt;CODE&gt;local&lt;/CODE&gt;) and you create your files there.  Inside this directory, you should put your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; file and inside this file you should have something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///path/to/my/file.log]
sourcetype=MyApp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might also add &lt;CODE&gt;index=MyIndex&lt;/CODE&gt; if you would like to get your events out of &lt;CODE&gt;index=main&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;In the same directory structure, you should put your &lt;CODE&gt;props.conf&lt;/CODE&gt; file and inside this file you should have something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyApp]
INDEXED_EXTRACTIONS = json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This set of files needs to be put on your Forwarders and the Splunk instances there all restarted.&lt;/P&gt;

&lt;P&gt;That is mostly it but you will probably like to do some other things, too.  For example, there's a TIMESTAMP_FIELDS setting that exploits the JSON structure rather than specifying TIME_FORMAT or TIME_PREFIX expressions to manually walk through the structure; see more here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 06:52:12 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2020-09-29T06:52:12Z</dc:date>
    <item>
      <title>should_linemerge for json data using universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151971#M30928</link>
      <description>&lt;P&gt;I have an application writing out JSON formatted logfile entries that we're using the universal forwarder to get over to the indexer system.   The log entries (client-side) could be several lines per second.   I didn't define a sourcetype when I added the monitor on the forwarder system (yes, I know 'now').   So the result is that the indexer is 'helping' too much and it sometimes puts multiple entries into one event as seen on the splunk console.&lt;/P&gt;

&lt;P&gt;Questions:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;would specifying a sourcetype on the 'forwarder' system be the right thing to do here ?&lt;/LI&gt;
&lt;LI&gt;which sourcetype do I pick ?   It's a internally written app that writes one-line records to a logfile we monitor.  Those lines just 'happen' to be valid JSON&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;do I need to create a custom sourcetype to specify, and set SHOULD_LINEMERGE=false in a props.conf file ?&lt;/LI&gt;
&lt;LI&gt;and do I do the props.conf file on the server side, or the client side ?  We deploy the forwarders using puppetlabs-splunk and really do not want to have to touch the splunk server at all when adding a forwarder system feeding it data&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I poked around a little with "splunk btool props list &amp;lt;sourcetype_here&amp;gt;" and can see which types do or don't linemerge, but there are a 'lot' of known sourcetypes.  Any suggestions on which one to pick if we can (hopefully) not need to create our own ?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2015 17:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151971#M30928</guid>
      <dc:creator>vinceskahan</dc:creator>
      <dc:date>2015-07-31T17:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: should_linemerge for json data using universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151972#M30929</link>
      <description>&lt;P&gt;If your'e using a universal forwarder, the sourcetype definition should be on Indexers (server side). If your data is in just single line, SHOULD_LINEMERGE should be false.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2015 17:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151972#M30929</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-07-31T17:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: should_linemerge for json data using universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151973#M30930</link>
      <description>&lt;P&gt;Makes a devops deployment kind of hard to do.  No way to control should_linemerge from the client side using the universal forwarder ?   Does the forwarder support props/transforms ?  Setting a known sourcetype that has should_linemerge=false on the server side already ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151973#M30930</guid>
      <dc:creator>vinceskahan</dc:creator>
      <dc:date>2020-09-29T06:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: should_linemerge for json data using universal forwarder</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151974#M30931</link>
      <description>&lt;P&gt;Generally what you do, if you are not using somebody else's configuration files (e.g. from an app on apps.splunk.com), is you create your own app directory like &lt;CODE&gt;$SPLUNK_HOME/etc/apps/MyApp/default&lt;/CODE&gt; (yes, since you are the developer of this app, you use &lt;CODE&gt;default&lt;/CODE&gt;, not &lt;CODE&gt;local&lt;/CODE&gt;) and you create your files there.  Inside this directory, you should put your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; file and inside this file you should have something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///path/to/my/file.log]
sourcetype=MyApp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might also add &lt;CODE&gt;index=MyIndex&lt;/CODE&gt; if you would like to get your events out of &lt;CODE&gt;index=main&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;In the same directory structure, you should put your &lt;CODE&gt;props.conf&lt;/CODE&gt; file and inside this file you should have something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[MyApp]
INDEXED_EXTRACTIONS = json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This set of files needs to be put on your Forwarders and the Splunk instances there all restarted.&lt;/P&gt;

&lt;P&gt;That is mostly it but you will probably like to do some other things, too.  For example, there's a TIMESTAMP_FIELDS setting that exploits the JSON structure rather than specifying TIME_FORMAT or TIME_PREFIX expressions to manually walk through the structure; see more here:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Extractfieldsfromfileheadersatindextime&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/should-linemerge-for-json-data-using-universal-forwarder/m-p/151974#M30931</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-09-29T06:52:12Z</dc:date>
    </item>
  </channel>
</rss>

