Getting Data In

Stream not logging as separate events

kamal87
Observer

Trying to send data to Splunk using 'services/receivers/stream', but data is not logged as separated event; instead its getting logged as one event.

Code:

HttpURLConnection huc = (HttpURLConnection)url.openConnection();

huc.setRequestProperty ("x-splunk-input-mode", "streaming");

huc.setRequestMethod("POST");
huc.setDoOutput(true);

String content = "abc";

huc.getOutputStream().write(content.getBytes());
huc.getOutputStream().flush();

content = "xyz";

huc.getOutputStream().write(content.getBytes());
huc.getOutputStream().flush();
huc.getOutputStream().close();

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security: Your Command Center for PCI DSS Compliance

Every security professional knows the drill. The PCI DSS audit is approaching, and suddenly everyone's asking ...

Developer Spotlight with Guilhem Marchand

From Splunk Engineer to Founder: The Journey Behind TrackMe    After spending over 12 years working full time ...

Cisco Catalyst Center Meets Splunk ITSI: From 'Payments Are Down' to Root Cause in ...

The Problem: When Networks and Services Don't Talk Payment systems fail at a retail location. Customers are ...