<?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: Entire file contents as a single event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27775#M4675</link>
    <description>&lt;P&gt;Just set the LINE_BREAKER for the sourcetype to something that will never match, such as &lt;CODE&gt;(?!)&lt;/CODE&gt;. You will also probably also need to increase MAX_EVENTS (default is only 500 lines, there isn't a hard limit I know of) and TRUNCATE to something larger than the biggest file size (or I think 0 is unlimited).&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2010 04:20:39 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-08-11T04:20:39Z</dc:date>
    <item>
      <title>Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27774#M4674</link>
      <description>&lt;P&gt;I would like to know how to setup Splunk to monitor a local input directory, BUT the new files which are added (which contain multiple lines) are ingested by Splunk and only create 1 new event per file (containing all of the file's contents). I do have the ability to manipulate the file data to add line-breaks if that is the solution. &lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2010 03:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27774#M4674</guid>
      <dc:creator>keiche</dc:creator>
      <dc:date>2010-08-11T03:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27775#M4675</link>
      <description>&lt;P&gt;Just set the LINE_BREAKER for the sourcetype to something that will never match, such as &lt;CODE&gt;(?!)&lt;/CODE&gt;. You will also probably also need to increase MAX_EVENTS (default is only 500 lines, there isn't a hard limit I know of) and TRUNCATE to something larger than the biggest file size (or I think 0 is unlimited).&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2010 04:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27775#M4675</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-11T04:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27776#M4676</link>
      <description>&lt;P&gt;Do you want Splunk to create one event per file, or do you want it to create one event per line?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2010 05:24:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27776#M4676</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2010-08-11T05:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27777#M4677</link>
      <description>&lt;P&gt;I use a regular monitor stanza combined with a custom sourcetype to index full files of interest.&lt;/P&gt;

&lt;P&gt;I use the following monitor to index changes to my splunk configs for example (inputs.conf):&lt;/P&gt;

&lt;PRE&gt;[monitor://C:\Program Files\Splunk\etc\...\*.conf]
followTail = False
sourcetype = splunk_config
index = my_custom_index
disabled = false&lt;/PRE&gt;

&lt;P&gt;and define the splunk_config sourcetype in props.conf as such:&lt;/P&gt;

&lt;PRE&gt;[splunk_config]
BREAK_ONLY_BEFORE=goblygook
MAX_EVENTS=200000
DATETIME_CONFIG = NONE
CHECK_METHOD = modtime
pulldown_type = true
LEARN_MODEL = false&lt;/PRE&gt;

&lt;P&gt;this combination will index all files under splunk\etc ending in .conf. The BREAK_ONLY_BEFORE=gooblybook basically tells splunk not to break the event (in this case the conf file) until it encounters "gooblygook" which shouldn't be in any of your files.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:10:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27777#M4677</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2020-09-28T09:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27778#M4678</link>
      <description>&lt;P&gt;As a note to anyone else who may be using this page as a reference, I had been using the LINE_BREAKER directive to do this (as outlined by gkanapathy), but this stopped working when we upgraded our indexers to 4.3. I had to change our props.conf entries for these kinds of inputs to use the method shown by ftk. I verified that the first method fails whether using lightweight or heavy forwarders, as long as the machine that is processing the props.conf for the sourcetype is 4.3.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2012 23:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27778#M4678</guid>
      <dc:creator>gcoles</dc:creator>
      <dc:date>2012-02-21T23:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27779#M4679</link>
      <description>&lt;P&gt;In regards to gcoles findings about the first approach not working with Splunk 4.3:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = (?!)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This approach still works in Splunk 4.3 with a minor modification. The expression needs to be surrounded by an additional pair of parantheses:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER = ((?!))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think this is because Splunk 4.3 requires the regular expression to have at least one capture expression, and earlier Splunk versions did not enforce this. The "(?!)" is merely a lookahead expression, the additional pair of parentheses does add a capture expression.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 17:34:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27779#M4679</guid>
      <dc:creator>amfranz</dc:creator>
      <dc:date>2012-04-04T17:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27780#M4680</link>
      <description>&lt;P&gt;Update: Check out this answer to the same question &lt;A href="http://answers.splunk.com/answers/106075/each-file-as-one-single-splunk-event"&gt;Each File as One Single Splunk Event&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysinglefilesourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ((*FAIL))
TRUNCATE = 99999999
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think this is newer information&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2014 16:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/27780#M4680</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-01-30T16:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/550527#M91418</link>
      <description>&lt;P&gt;It doesn't enough if you forward data to the indexer. It is just useful for local file monitoring.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 13:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/550527#M91418</guid>
      <dc:creator>Yashar_Shah</dc:creator>
      <dc:date>2021-05-05T13:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Entire file contents as a single event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/551903#M91594</link>
      <description>&lt;P&gt;Is this still good in 2021?&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 17:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Entire-file-contents-as-a-single-event/m-p/551903#M91594</guid>
      <dc:creator>adobrzeniecki</dc:creator>
      <dc:date>2021-05-17T17:06:38Z</dc:date>
    </item>
  </channel>
</rss>

