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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...