Getting Data In

Access Splunk through ColdFusion


Is it possible, and if so how, to dispatch searches in Splunk and display the results using Coldfusion. I have been looking at REST and cURL but can't quite wrap my head around getting either one to work with ColdFusion. I do not want to see ColdFusion logs I want to see search results displayed in ColdFusion pages.

if I do this

<title>Splunk Test</title>

<cfset tmp = {} />
<cfhttp url='https://localhost:8089/'  username="admin"  password="changeme" result="r" method="post" >
<cfhttpparam type="header" name="content-type" value="application/json" />

<cfhttpparam type="body" value="#serializeJson(tmp)#" />

<cfdump var="#r#" />


I get the following response


Charset [empty string]  
ErrorDetail I/O Exception: PKIX path building failed: Could not build a validated path.  
Filecontent Connection Failure  
Header [empty string]  
Mimetype Unable to determine MIME type of file.  

struct [empty]

Statuscode Connection Failure. Status code unavailable.  
Text YES 

Is what I am trying even possible?

0 Karma


Yes, what you are doing is possible. The error you see is from Coldfusion trying to validate the Splunk server certificate. Is it self-signed? then you need to turn the https validation off. Check out and see if one of those SDKs would help.

0 Karma
Did you miss .conf21 Virtual?

Good news! The event's keynotes and many of its breakout sessions are now available online, and still totally FREE!