cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
RC_Flyer
Level I

Logging to SPLUNK from a JMP script

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

3 REPLIES 3
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Logging to SPLUNK from a JMP script

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;
RC_Flyer
Level I

Re: Logging to SPLUNK from a JMP script

At least in our SPLUNK instance the separator between Name and VALUE is a colon.  So, 
"event" => "Test message"

becomes

"event" : "Test message"

Re: Logging to SPLUNK from a JMP script

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()

Recommended Articles