<?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: Why are REST API receivers/simple breaks input unexpectedly? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/690057#M114827</link>
    <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#Line_breaking" target="_blank" rel="noopener"&gt;Line breaking&lt;/A&gt;&amp;nbsp;describes MAX_EVENTS thus:&lt;/P&gt;&lt;PRE&gt;MAX_EVENTS = &amp;lt;integer&amp;gt;
* The maximum number of input lines to add to any event.
* Splunk software breaks after it reads the specified number of lines.
* Default: 256&lt;/PRE&gt;&lt;P&gt;I looked at my broken events, maximum number of lines seems to be 257. &amp;nbsp;Knowing some of my outputs are &amp;gt; 1000, I added MAX_EVENTS = 2000 to the sourcetype. &amp;nbsp;Now I am seeing new events with large number of lines, no more broken events. (It took some time for this change to take effect, though.)&lt;/P&gt;&lt;P&gt;Just to be clear: This is unrelated to REST API receivers/simple endpoint, merely a matter of lines in individual events. &amp;nbsp;The limit is set in&amp;nbsp;props.conf per source type; that is why I could not find any applicable setting in limit.conf.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Jun 2024 21:29:04 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2024-06-08T21:29:04Z</dc:date>
    <item>
      <title>Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/587308#M103171</link>
      <description>&lt;P&gt;I have a script that sends effectively yum outputs to receivers/simple. &amp;nbsp;props.conf says&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[yumstuff]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DATETIME_CONFIG = &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LINE_BREAKER = ([\r\n]+)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NO_BINARY_CHECK = true&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;category = Miscellaneous&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;pulldown_type = 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I expect the each post to be one event. &amp;nbsp;But some posts get broken into multiple events for unknown reasons. &amp;nbsp;My guess is that those posts are longer, although I couldn't find any applicable limit in limits.conf. &amp;nbsp;The broken ones are not all that long to start. &amp;nbsp;I examined one that was broken into three "events ". &amp;nbsp;Combined, they have 18543 chars, 271 lines. &amp;nbsp;The closest attribute in limits.conf I can find is maxchars, but that's for [kv] only, and the limit is already high:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[kv]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;indexed_kv_limit = 1000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;maxchars = 40960&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The way it is broken also confuses me. &amp;nbsp;My post begins with a timestamp, followed by some bookkeeping kv pairs, then yum output. &amp;nbsp;If this breakage is caused by limits, I would expect the event containing the first part to be the biggest, to the extent it exceeds that limit. &amp;nbsp;But in general, the "event" corresponding to the end of the post is the biggest; even stranger, the middle "event" generally is extremely small containing only one line. &amp;nbsp;In the post I examined, for example, the first "event" contained 6710 chars, the second, 71 chars, the last, 11762 chars. &amp;nbsp;The breaking points are not special, either. &amp;nbsp;For example,&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;2022-02-09T19:51:28&lt;/SPAN&gt;+&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;00&lt;/SPAN&gt;:&lt;SPAN class=""&gt;00&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Package&lt;/SPAN&gt; &lt;SPAN class=""&gt;iwl6000g2b-firmware.noarch&lt;/SPAN&gt; &lt;SPAN class=""&gt;0:18.168.6.1-79.el7&lt;/SPAN&gt; &lt;SPAN class=""&gt;will&lt;/SPAN&gt; &lt;SPAN class=""&gt;be&lt;/SPAN&gt; &lt;SPAN class=""&gt;updated&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Package&lt;/SPAN&gt; &lt;SPAN class=""&gt;iwl6000g2b-firmware.noarch&lt;/SPAN&gt; &lt;SPAN class=""&gt;0:18.168.6.1-80.el7_9&lt;/SPAN&gt; &lt;SPAN class=""&gt;will&lt;/SPAN&gt; &lt;SPAN class=""&gt;be&lt;/SPAN&gt; &lt;SPAN class=""&gt;an&lt;/SPAN&gt; &lt;SPAN class=""&gt;update&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;break&amp;gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Package&lt;/SPAN&gt; &lt;SPAN class=""&gt;iwl6050-firmware.noarch&lt;/SPAN&gt; &lt;SPAN class=""&gt;0:41.28.5.1-79.el7&lt;/SPAN&gt; &lt;SPAN class=""&gt;will&lt;/SPAN&gt; &lt;SPAN class=""&gt;be&lt;/SPAN&gt; &lt;SPAN class=""&gt;updated&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV class=""&gt;&amp;lt;break&amp;gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Package&lt;/SPAN&gt; &lt;SPAN class=""&gt;iwl6050-firmware.noarch&lt;/SPAN&gt; &lt;SPAN class=""&gt;0:41.28.5.1-80.el7_9&lt;/SPAN&gt; &lt;SPAN class=""&gt;will&lt;/SPAN&gt; &lt;SPAN class=""&gt;be&lt;/SPAN&gt; &lt;SPAN class=""&gt;an&lt;/SPAN&gt; &lt;SPAN class=""&gt;update&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;--&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;Package&lt;/SPAN&gt; &lt;SPAN class=""&gt;iwl7260-firmware.noarch&lt;/SPAN&gt; &lt;SPAN class=""&gt;0:25.30.13.0-79.el7&lt;/SPAN&gt; &lt;SPAN class=""&gt;will&lt;/SPAN&gt; &lt;SPAN class=""&gt;be&lt;/SPAN&gt; &lt;SPAN class=""&gt;updated&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class=""&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where should I look?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 22:32:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/587308#M103171</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-03-10T22:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592106#M103655</link>
      <description>&lt;P&gt;That's interesing because the receivers/simple should not break the event at all. As I understand the docs you're supposed to put your whole single event as a request body (that's why it's better to use normal HEC endpoint, apart from the possible additional fields). And as I checked, I had no problem, and splunk wouldn't break it on any line breaks.&lt;/P&gt;&lt;P&gt;Are you sure you're not sending your text in chunks?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 18:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592106#M103655</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-03T18:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592109#M103656</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Are you sure you're not sending your text in chunks?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I do not have a mechanism to break text in chunks. &amp;nbsp;The shell script essentially feeds yum output to REST API.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;report() {
  stage=$1
  yum_status=$2
  source=$3
  &amp;lt;stuff...&amp;gt;

  curl -H "Authorization: Bearer $auth_token" \
    -d "$(date --rfc-3339=seconds|tr ' ' T) stage=$stage user=$user status=$status yum_status=$yum_status $auto" \
    -d "$(&amp;lt;$source)" \
    -X POST "$api_url?sourcetype=os_patch&amp;amp;source=$source&amp;amp;host=$HOSTNAME" \
    2&amp;gt;/dev/null &amp;gt;&amp;amp;2
} end report

systemPatch () {
  &amp;lt;stuff...&amp;gt;
  yum &amp;lt;...&amp;gt; | tee /var/tmp/${FUNCNAME[0]}.out
  report ${FUNCNAME[0]} $os_patch_status /var/tmp/${FUNCNAME[0]}.out
} # end systemPatch&lt;/LI-CODE&gt;&lt;P&gt;The actual second&amp;nbsp;&lt;FONT face="courier new,courier"&gt;-d&lt;/FONT&gt; feed can be slightly more nuanced than "$(&amp;lt;$source)". &amp;nbsp;For example, it can sometimes be composed of multiple segments extracted from $source. &amp;nbsp;Despite variations in &lt;FONT face="courier new,courier"&gt;-d&lt;/FONT&gt; composition, it is always one string with multiple lines. &amp;nbsp;Because the same composition is found in fragmented events and integral events, I doubt if those small variations play any role.&lt;/P&gt;&lt;P&gt;Meanwhile, you point to a possible direction for research. &amp;nbsp;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 21:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592109#M103656</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-04-03T21:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592110#M103657</link>
      <description>&lt;P&gt;Hmm. I tested by posting over 100kB of events (generated in bash with seq loops ;-)) and nothing ever broke into multiple events. Regardless of whether I let bash insert line breaks or I put explicit \r or \n - the events never broke into multiple ones. Even with consecutive line breaks.&lt;/P&gt;&lt;P&gt;That's why I'm asking because the behaviour is indeed strange.&lt;/P&gt;&lt;P&gt;BTW, if you're calling curl with multiple -d options you'll get your data sent as url-encoded, you know that?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 22:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592110#M103657</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-03T22:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592121#M103659</link>
      <description>&lt;P&gt;Thanks for help with testing! &amp;nbsp;This can rule out length as a sole determinant. &amp;nbsp;I haven't thought of controlled experiment like that, but I should. &amp;nbsp;Maybe my network buffer is causing hiccups at random points?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 04:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592121#M103659</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-04-04T04:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592186#M103665</link>
      <description>&lt;P&gt;Well, that's puzzling indeed since single curl call should give you a single HTTP request (unless you're following redirections but that's another story). If your request were too large, you should have been given an error by the server, curl shouldn't "split" the request in two. So that's completely puzzling. Maybe some debug at splunkd side... but that seems a bit like overkill.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 11:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/592186#M103665</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-04T11:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why are REST API receivers/simple breaks input unexpectedly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/690057#M114827</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#Line_breaking" target="_blank" rel="noopener"&gt;Line breaking&lt;/A&gt;&amp;nbsp;describes MAX_EVENTS thus:&lt;/P&gt;&lt;PRE&gt;MAX_EVENTS = &amp;lt;integer&amp;gt;
* The maximum number of input lines to add to any event.
* Splunk software breaks after it reads the specified number of lines.
* Default: 256&lt;/PRE&gt;&lt;P&gt;I looked at my broken events, maximum number of lines seems to be 257. &amp;nbsp;Knowing some of my outputs are &amp;gt; 1000, I added MAX_EVENTS = 2000 to the sourcetype. &amp;nbsp;Now I am seeing new events with large number of lines, no more broken events. (It took some time for this change to take effect, though.)&lt;/P&gt;&lt;P&gt;Just to be clear: This is unrelated to REST API receivers/simple endpoint, merely a matter of lines in individual events. &amp;nbsp;The limit is set in&amp;nbsp;props.conf per source type; that is why I could not find any applicable setting in limit.conf.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 21:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-are-REST-API-receivers-simple-breaks-input-unexpectedly/m-p/690057#M114827</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-06-08T21:29:04Z</dc:date>
    </item>
  </channel>
</rss>

