All Apps and Add-ons

RFE: Can you add support to write to influx cloud via HTTPS?

hisands
New Member

Hi Yasaswy Ravala,

One of the requirements that i have is to write data to influx cloud which only accepts data over HTTPS. I can see that the change should be fairly simple. It would be of a great help if you can make this change.

Instead of hard coding the posturl to be always http, in the get_influxdb_instance_details() in the file splunk_to_influxdb.py, can we add an option in the UI to choose if we want to do HTTP or HTTPS and read from there?

def get_influxdb_instance_details():
        try:
                req = service.request("storage/collections/data/influxdbconf/%s" % infdb_instance,method='get')
                log.info('Successfully accessed collection data for %s' % infdb_instance)
        except Exception, e:
                log.error('Unable to access collection data  %s' % str(e))
                sys.exit()

        try:
        global infdbhost, infdbport, infdbuser, infdbaccs, infdbdb, posturl
                coldata_raw = req.body.read()
                coldata = re.sub(r'[([\])\']','', coldata_raw)
                coldata_port = json.loads(coldata)
                infdbhost = (coldata_port['infdbHost'])
                infdbport = (coldata_port['infdbPort'])
                infdbuser = (coldata_port['infdbUser'])
                infdbaccs = (coldata_port['_infdbPass'])
                infdbdb = (coldata_port['infdbDatabase'])
                **posturl = 'http://%s:%s/write?db=%s&precision=ms&p=%s&u=%s' % (infdbhost,infdbport,infdbdb,infdbaccs,infdbuser)**
                log.info('Successfully parsed collection data %s,%s,%s,%s' % (infdbhost,infdbport,infdbuser,infdbdb))
        except Exception, e:
                log.error('Unable to parse collection data %s' % str(e))
                sys.exit()

Thanks,
Sandeep.

0 Karma

indeed_2000
Motivator

@hisands did you connect splunkdb with influxdb?

i try it but got error:

https://community.splunk.com/t5/Splunk-Search/driver-influxdb-to-splunk-db/m-p/605850#M210681

would please how do you do this?

 Thanks

0 Karma

Yasaswy
Contributor

This has now been added... will work from v1.7. Provide the info as https:port (Eg. https:8089) in the influx_configs tab under protcol:port

arnost_m
Engager

Works! Thanks

0 Karma

Yasaswy
Contributor

hi Sandeep,
Very reasonable ask. Have not been checking answers for a while. Will add shortly and update..

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...