Has anyone written JSL to send messages to a SPLUNK instance? The idea would be to capture all of the log messages from multiple applications in a single spot
I've not used splunk but the idea of central logging is a good one. It does look easy enough to send data to splunk once the server is set up. This is not tested, but something close to this should do the trick:
New HTTP Request( URL( "https://your-hostname:8088/services/collector" ), Method( "POST" ), Headers([ "Accept" => "application/json", "Authorization" => "Splunk your-hec-token" ]), JSON([ "event" => "Test message", "sourcetype" => "jmp/jsl" ]) ) << Send;
At least in our SPLUNK instance the separator between Name and VALUE is a colon. So, "event" => "Test message"
becomes
"event" : "Test message"
There are several Python packages that support logging to splunk. It's far easier to utilize an existing Python package than having to roll your own REST handling interface code in JSL.
My google query: python package for logging to splunk.
The top hit was
splunk-handler: A popular and widely used asynchronous logging handler that sends events to the Splunk HEC. It is designed to be a "drop-in" replacement for standard Python logging handlers.
With the Python Integration, you can utilize such packages and call from JSL with the Python Submit() or the Python Execute()