<?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: How does Splunk handle udp data streams? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85589#M17792</link>
    <description>&lt;P&gt;Splunk breaks on linebreaks by default. This is defined using the &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; directive in props.conf. However, there's also a directive &lt;CODE&gt;BREAK_ONLY_BEFORE_DATE&lt;/CODE&gt; that tells Splunk not to break until it finds a timestamp. This defaults to true.&lt;/P&gt;

&lt;P&gt;Because of this, and because the events in your log do not have individual timestamps, Splunk won't break them up into individual events. There are two solutions to this that I can think of:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Set &lt;CODE&gt;BREAK_ONLY_BEFORE_DATE&lt;/CODE&gt; to false in props.conf. This should make Splunk rely only on the defined &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; for breaking events, and take the time that it received the event as timestamp. The drawback is that you won't know when the event was actually generated, so if you import old logs into Splunk you will get incorrect timestamps.&lt;/LI&gt;
&lt;LI&gt;Modify your script to include a timestamp for each event. This would be my preferred solution.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 20 Apr 2011 20:55:09 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2011-04-20T20:55:09Z</dc:date>
    <item>
      <title>How does Splunk handle udp data streams?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85587#M17790</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;When I stream UDP data to Splunk using a script to pipe Apache access logs via scripts.  The splunk server combines all of the session log data into one entry instead of separate entries, example entry:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;4/20/11
11:42:06.000 AM

access_log[25674]: IP="172.168.5.4" HH="www.someweb.com" US=97947 RQ="GET / HTTP/1.1" ST=200 SZ=9102 CON="-" REF="-" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=90289
access_log[25675]: IP="172.168.5.4" HH="www.someweb.com" US=46385 RQ="GET /home/ HTTP/1.1" ST=200 SZ=9563 CON="-" REF="http://www.someweb.com/" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=39386
access_log[25673]: IP="172.168.5.4" HH="www.someweb.com" US=44823 RQ="GET /family/ HTTP/1.1" ST=200 SZ=9335 CON="-" REF="http://www.someweb.com/someweb-home/" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=36921
access_log[25679]: IP="172.168.5.4" HH="www.someweb.com" US=60747 RQ="GET /how_3391681_handle-unruly-children.html HTTP/1.1" ST=200 SZ=12685 CON="-" REF="http://www.someweb.com/someweb-family/" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=53606
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is a simple perl script I'm using to stream Apache access logs via named pipe:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/usr/bin/perl
use IO::Socket;

my $server = $ARGV[0];
my $protocol = $ARGV[1];
my $port = $ARGV[2];

my $socket = IO::Socket::INET-&amp;gt;new(PeerAddr =&amp;gt; $server, PeerPort =&amp;gt; $port, Proto =&amp;gt; "$protocol", Type =&amp;gt; SOCK_DGRAM);

$| = 1;

while ( &amp;lt;STDIN&amp;gt; ) {
 chomp $_;
 print $socket "$_\n";
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the apache config:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CustomLog "| /usr/local/bin/apache_pipe.pl 172.16.5.55 udp 4444" combine
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When streaming UDP data, do the splunk servers need a special char or signal to indicate the line is finished and to add a new entry?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2011 19:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85587#M17790</guid>
      <dc:creator>williamsweat</dc:creator>
      <dc:date>2011-04-20T19:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk handle udp data streams?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85588#M17791</link>
      <description>&lt;P&gt;I would recommend setting up the "SHOULD_LINEMERGE = false" property via props.conf.   For instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;##props.conf
[&amp;lt;your_sourcetype&amp;gt;]
SHOULD_LINEMERGE = false
#DATETIME_CONFIG = CURRENT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should tell Splunk to treat your data as single line events.  On a separate note, I would recommend ensuring that each of your log entries has a date and timestamp.  This will ensure that Splunk can properly extract an _time field for your events.  If this is not possible you should set &lt;CODE&gt;DATETIME_CONFIG = CURRENT&lt;/CODE&gt; as well.  This will tell Splunk to take &lt;CODE&gt;_time&lt;/CODE&gt; as your index time (&lt;CODE&gt;_indextime&lt;/CODE&gt;).&lt;/P&gt;

&lt;P&gt;See also: &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Propsconf" target="_blank"&gt;props.conf.spec&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85588#M17791</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2020-09-28T09:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk handle udp data streams?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85589#M17792</link>
      <description>&lt;P&gt;Splunk breaks on linebreaks by default. This is defined using the &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; directive in props.conf. However, there's also a directive &lt;CODE&gt;BREAK_ONLY_BEFORE_DATE&lt;/CODE&gt; that tells Splunk not to break until it finds a timestamp. This defaults to true.&lt;/P&gt;

&lt;P&gt;Because of this, and because the events in your log do not have individual timestamps, Splunk won't break them up into individual events. There are two solutions to this that I can think of:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Set &lt;CODE&gt;BREAK_ONLY_BEFORE_DATE&lt;/CODE&gt; to false in props.conf. This should make Splunk rely only on the defined &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; for breaking events, and take the time that it received the event as timestamp. The drawback is that you won't know when the event was actually generated, so if you import old logs into Splunk you will get incorrect timestamps.&lt;/LI&gt;
&lt;LI&gt;Modify your script to include a timestamp for each event. This would be my preferred solution.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 20 Apr 2011 20:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85589#M17792</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-04-20T20:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk handle udp data streams?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85590#M17793</link>
      <description>&lt;P&gt;Splunk does have a default LINE_BREAKER setting which defaults to ([\r\n]+) however SHOULD_LINEMERGE is "True" by default which enables the BREAK_ONLY_BEFORE_DATE, BREAK_ONLY_BEFORE, MUST_BREAK_AFTER, ... settings.  Setting SHOULD_LINEMERGE = false disables those settings and uses the default LINE_BREAKER.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:28:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85590#M17793</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2020-09-28T09:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk handle udp data streams?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85591#M17794</link>
      <description>&lt;P&gt;Thanks!  This is excellent&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2011 22:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-does-Splunk-handle-udp-data-streams/m-p/85591#M17794</guid>
      <dc:creator>williamsweat</dc:creator>
      <dc:date>2011-04-20T22:20:39Z</dc:date>
    </item>
  </channel>
</rss>

