<?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 Adding custom data from file in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681502#M113865</link>
    <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;I am ingesting data into Splunk Enterprise from a file. This file contains a lot of information, and I would like Splunk to make the events start on the &lt;EM&gt;##start_string&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and end on the line before the next occurrence &lt;EM&gt;##end_string&lt;BR /&gt;&lt;/EM&gt;Within these blocks there are different fields with the form-&amp;gt; &lt;EM&gt;##key = value&lt;BR /&gt;&lt;/EM&gt;Here is an example of the file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;…..
##start_string
##Field = 1
##Field2 = 12
##Field3 = 1
##Field4 =
##end_string
.......
##start_string
##Field = 22
##Field2 = 12
##Field3 = field_value
##Field4 =
##Field8 = 1
##Field7 = 12
##Field6 = 1
##Field5 =
##end_string
……&lt;/LI-CODE&gt;&lt;P&gt;I have tried to create this sourcetype (with different regular expressions) but it creates only one event with all the lines:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATETIME_CONFIG =
LINE_BREAKER = ([\n\r]+)##start_string

##LINE_BREAKER = ([\n\r]+##start_string\s+(?&amp;lt;block&amp;gt;.*?)\s+## end_string
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = true
category = Custom
description = Format custom logs

pulldown_type = 1
disabled = false&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;How should I approach this case?&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Any ideas or help would be welcome&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks in advanced&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2024 16:44:57 GMT</pubDate>
    <dc:creator>Be_JAR</dc:creator>
    <dc:date>2024-03-21T16:44:57Z</dc:date>
    <item>
      <title>Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681502#M113865</link>
      <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;I am ingesting data into Splunk Enterprise from a file. This file contains a lot of information, and I would like Splunk to make the events start on the &lt;EM&gt;##start_string&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and end on the line before the next occurrence &lt;EM&gt;##end_string&lt;BR /&gt;&lt;/EM&gt;Within these blocks there are different fields with the form-&amp;gt; &lt;EM&gt;##key = value&lt;BR /&gt;&lt;/EM&gt;Here is an example of the file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;…..
##start_string
##Field = 1
##Field2 = 12
##Field3 = 1
##Field4 =
##end_string
.......
##start_string
##Field = 22
##Field2 = 12
##Field3 = field_value
##Field4 =
##Field8 = 1
##Field7 = 12
##Field6 = 1
##Field5 =
##end_string
……&lt;/LI-CODE&gt;&lt;P&gt;I have tried to create this sourcetype (with different regular expressions) but it creates only one event with all the lines:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATETIME_CONFIG =
LINE_BREAKER = ([\n\r]+)##start_string

##LINE_BREAKER = ([\n\r]+##start_string\s+(?&amp;lt;block&amp;gt;.*?)\s+## end_string
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = true
category = Custom
description = Format custom logs

pulldown_type = 1
disabled = false&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;How should I approach this case?&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;Any ideas or help would be welcome&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks in advanced&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 16:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681502#M113865</guid>
      <dc:creator>Be_JAR</dc:creator>
      <dc:date>2024-03-21T16:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681525#M113870</link>
      <description>&lt;P&gt;I recommend setting SHOULD_LINEMERGE to false so that Splunk does not try to re-combine your events together.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 11:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681525#M113870</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-03-21T11:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681665#M113903</link>
      <description>&lt;P&gt;I tried it, but it didn't work.&lt;BR /&gt;splunk does not create the events with the information between the delimiters:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;## MONIT_DOC_START&lt;BR /&gt;....&lt;BR /&gt;.....&lt;BR /&gt;## MONIT_DOC_END&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;BR /&gt;I have also tried this (unsuccessful) :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Be_JAR_0-1711112111543.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29849i744A73B2AA631479/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Be_JAR_0-1711112111543.png" alt="Be_JAR_0-1711112111543.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 13:01:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681665#M113903</guid>
      <dc:creator>Be_JAR</dc:creator>
      <dc:date>2024-03-22T13:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681712#M113907</link>
      <description>Have you try to escape # characters like \# ?</description>
      <pubDate>Fri, 22 Mar 2024 17:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681712#M113907</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-22T17:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681786#M113910</link>
      <description>&lt;P&gt;It should work. Here is how I have it set up:&lt;/P&gt;&lt;P&gt;log sample: (at /tmp/hashlogs)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;##start_string
##time = 1711292017
##Field2 = 12
##Field3 = field_value
##Field4 = somethingelse
##Field8 = 1
##Field7 = 12
##Field6 = 1
##Field5 =
##end_string
##start_string
##time = 1711291017
##Field2 = 12
##Field3 = field_value2
##Field4 = somethingelse3
##Field8 = 14
##Field7 = 12
##Field6 = 15
##Field5 =
##end_string
##start_string
##time = 1711282017
##Field2 = 12
##Field3 = asrsar
##Field4 = somethingelsec
##Field8 = 1
##Field7 = 12
##end_string&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;inputs.conf (on forwarder machine)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[monitor:///tmp/hashlogs]
index=main
sourcetype=hashlogs&lt;/LI-CODE&gt;&lt;P&gt;props.conf (on indexer machine)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[hashlogs]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\n\r]+)##start_string&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result: (search is index=* sourcetype=hashlogs)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marnall_0-1711292286542.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29878iFA54A3C23D2C27FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marnall_0-1711292286542.png" alt="marnall_0-1711292286542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2024 14:59:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681786#M113910</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-03-24T14:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681817#M113911</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263556"&gt;@marnall&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in my log (which has some line between event end markers and the next event start), something is wrong.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Some info
extra info
##start_string
##time = 1711292017
##Field2 = 12
##Field3 = field_value
##Field4 = somethingelse
##Field8 = 1
##Field7 = 12
##Field6 = 1
##Field5 =
##end_string
Some info
more info
extra info
##start_string
##time = 1711291017
##Field2 = 12
##Field3 = field_value2
##Field4 = somethingelse3
##Field8 = 14
##Field7 = 12
##Field6 = 15
##Field5 =
##end_string
SOme info
more info
info
extra info
##start_string
##time = 1711282017
##Field2 = 12
##Field3 = asrsar
##Field4 = somethingelsec
##Field8 = 1
##Field7 = 12
##end_string
Some info
extra info&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some idea to delimit events between the markers?&lt;BR /&gt;##start_string&lt;BR /&gt;##end_string&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;BR /&gt;JAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 08:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681817#M113911</guid>
      <dc:creator>Be_JAR</dc:creator>
      <dc:date>2024-03-25T08:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681829#M113912</link>
      <description>&lt;P&gt;It would be nice to get the real log format in the first phase not after 1st version has resolved!&lt;/P&gt;&lt;P&gt;Do all valid log rows starting with ##? If so then you should add transforms.conf which drop away other lines. If there is not any way to recognise those without looking ##start_string and ##end_string then you probably must write some preprocessing or your own modular input. Splunk's normal input processing handling those lines one by one and it cannot keep track other lines and is there happening something or not.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 09:29:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681829#M113912</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-25T09:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681836#M113913</link>
      <description>&lt;P&gt;Thank you very much for the clarification.&lt;BR /&gt;Yes, valid rows start with ##. And each event is what is inside each ##start_string and ##end_string block.&lt;BR /&gt;&lt;BR /&gt;From UI, is there any way to do the first step and remove the rows that do not start with ## ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BR&lt;BR /&gt;JAR&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 10:09:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681836#M113913</guid>
      <dc:creator>Be_JAR</dc:creator>
      <dc:date>2024-03-25T10:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681840#M113914</link>
      <description>&lt;P&gt;You can use SEDCMD to remove all lines not beginning with two hashes.&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;PRE&gt;SEDCMD-remove-unhashsed = s/^([^#]|#[^#]).*$//&lt;/PRE&gt;&lt;P&gt;(Haven't tested it though, might need some tweaking).&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 10:28:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681840#M113914</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-25T10:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681851#M113916</link>
      <description>&lt;P&gt;Then I propose you to use transforms.conf and send those lines into dev null. There are quite many examples on community and also on docs. See e.g.&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/sending-specific-events-to-nullqueue-using-props-amp-amp/m-p/660688" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/sending-specific-events-to-nullqueue-using-props-amp-amp/m-p/660688&lt;/A&gt;&amp;nbsp;just replace that REGEX to match your line or beginning of your line.&lt;/P&gt;&lt;P&gt;Basically SEDCMD do almost same. It just clears that line but it didn't remove it. Basically there are sill "empty" line on your log events, not removed line.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 12:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681851#M113916</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-25T12:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681854#M113917</link>
      <description>&lt;P&gt;The difference is that with SEDCMD you can "blank" part of a multiline event. If you send to nullQueue, you'll discard whole event.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 12:44:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681854#M113917</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-25T12:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681909#M113928</link>
      <description>Exactly that way. So you must select which one those are and based on that select SEDCMD or transforms.</description>
      <pubDate>Mon, 25 Mar 2024 21:20:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681909#M113928</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-25T21:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom data from file</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681999#M113951</link>
      <description>&lt;P&gt;Hi .&lt;/P&gt;&lt;P&gt;Trying with:&lt;/P&gt;&lt;P&gt;Field transformations:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Be_JAR_0-1711459220823.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29904i7728D5D54BB002F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Be_JAR_0-1711459220823.png" alt="Be_JAR_0-1711459220823.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And adding them to sourcetype:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Be_JAR_1-1711459220827.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29905iB920361EC3AE4B1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Be_JAR_1-1711459220827.png" alt="Be_JAR_1-1711459220827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But does not work&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Be_JAR_2-1711459220828.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29903i4D85132D514CFAEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Be_JAR_2-1711459220828.png" alt="Be_JAR_2-1711459220828.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;is there anything wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 13:21:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Adding-custom-data-from-file/m-p/681999#M113951</guid>
      <dc:creator>Be_JAR</dc:creator>
      <dc:date>2024-03-26T13:21:29Z</dc:date>
    </item>
  </channel>
</rss>

