Getting Data In

How to send events over long-lived TCP connection?

giraffe
Explorer

Our application generates many small monitoring events. We are feeding these to Splunk by TCP. We would like to keep a single connection open between each of our processes and the Splunk TCP input. However, when we do this the events do not appear when sent over the TCP connection, but only when the TCP stream is closed. Then they all appear together as a single event.

How do we configure the TCP input to generate one event per line as they stream in, instead of treating all data received over the connection as a single event?

Tags (2)
1 Solution

Ayn
Legend

You need to tell Splunk when to break the incoming data into new events. Right now Splunk doesn't find anything to break the events on, so it waits until the end of the input stream. By default Splunk will create a new event when it encounters something it recognizes as a timestamp, or when the maximum defined number of lines in an event has been reached (default 256). These settings are specified in props.conf (docs: http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf - the settings you're looking for are MAX_EVENTS and BREAK_ONLY_BEFORE_DATE).

Could you paste some sample events? That way we could help with coming up with working settings for breaking your log stream into individual events.

View solution in original post

0 Karma

Vladimir
Path Finder

You can add timestamp/unix time to the begging of event line. For example:

1320663001,event1
1320663002,event2

In this case splunk will divide events

unix time is a "date +%s" command in linux systems, or $sTimeStamp = get-date ((Get-Date).touniversaltime()) -uformat "%s" in PowerShell

Ayn
Legend

You need to tell Splunk when to break the incoming data into new events. Right now Splunk doesn't find anything to break the events on, so it waits until the end of the input stream. By default Splunk will create a new event when it encounters something it recognizes as a timestamp, or when the maximum defined number of lines in an event has been reached (default 256). These settings are specified in props.conf (docs: http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf - the settings you're looking for are MAX_EVENTS and BREAK_ONLY_BEFORE_DATE).

Could you paste some sample events? That way we could help with coming up with working settings for breaking your log stream into individual events.

0 Karma

giraffe
Explorer
0 Karma

giraffe
Explorer

I've found a props.conf in etc/system/defaults. Can I create one in /etc/system/local? And if so, will the definitions in there be merged with the one in etc/system/defaults or will the defaults be ignored?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...