A while ago I released an App on Splunkbase called Protocol Data Inputs (PDI) that allows you to send text or binary data to Splunk via many different protocols and dynamically apply pre processors to act on this data prior to indexing in Splunk. You can read more about it here.
I thought I’d just share this interesting use case that I was fiddling around with today. What if I wanted to send compressed data (which is a binary payload) to Splunk and index it ? Well , this is very trivial to accomplish with PDI.
PDI supports many different protocols , but for the purposes of this example I just rolled a dice and chose HTTP POST. I could have chosen raw TCP,UDP, SockJS or WebSockets and the steps in this blog for handling the binary data are the same.
Likewise for the binary payload. I just chose compressed Gzip data(could have chosen another compression algorithm) because more people can likely relate for the purposes of an example blog rather than using an example of an industry proprietary binary protocol like ISO8583 (financial services) or MATIP(aviation) or binary data encodings such as Avro or ProtoBuf.
Note , Splunk’s HTTP Event collector can also support a Gzip payload.
PDI has many options , but for this simple example you only need to choose the protocol and a port number.
You can see this above in the Custom Data Handler section. I’ve bundled this custom handler in with the PDI v1.2 release for convenience.Here is the source if you are interested. Handlers can be written in numerous JVM languages and then applied by simply declaring them in your PDI stanza as above and putting the code in the protocol_ta/bin/datahandlers directory, there are more template examples here.
The GZipHandler will intercept the compressed binary payload and decompress it into text for indexing in Splunk.
I just wrote a simple Python script to HTTP POST a compressed payload to Splunk.
I hope this simple example can get you thinking about unleashing all that valuable binary data you have and sending it to Splunk.
----------------------------------------------------
Thanks!
Damien Dallimore
The Splunk platform removes the barriers between data and action, empowering observability, IT and security teams to ensure their organizations are secure, resilient and innovative.
Founded in 2003, Splunk is a global company — with over 7,500 employees, Splunkers have received over 1,020 patents to date and availability in 21 regions around the world — and offers an open, extensible data platform that supports shared data across any environment so that all teams in an organization can get end-to-end visibility, with context, for every interaction and business process. Build a strong data foundation with Splunk.