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!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...