Flux and sql.from

Hi,

I’m looking into using the new flux language to get some information from a MySQL database.

At the moment I have a powershell script that runs ever 24 hours to collect information about a VSAN cluster (cluster name, host names, version, build and time stamp for the insert query). I’ve seen there is Sql.to() which will write data to a sql database. How can I use sql.from() to write some infromation back into InfluxDB? Is that possible?

Still new to Flux (installed it about an hour ago).

Using influxDB 1.8.4, latest chronograf version.

Querying the data with sql.from() does show me results, I’m just curious about writing them to influx :slight_smile:

Thanks

Phil

Hello @philb,
Have you tried using the to() function? https://docs.influxdata.com/flux/v0.x/stdlib/influxdata/influxdb/to/

Hi @Anaisdg

I’m very sorry I’ve not been on the forums for a while, I didn’t realise you had replied!

I did some more looking and i think the problem is we’re using 1.x - the sql.to() function looks to only be available in Flux for influx 2.0. I can’t find any reference to it in the 1.8 documentation, I think I’d been reading the wrong documentation when i assumed I could do this with 1.8

Unfortunately migrating to influx 2.0 isn’t an easy option for us, we’ve built our application based on the 1.x engine and Kapacitor, we’re not overly keen on rewriting everything.

I can work around it with PowerShell for now I think.

Thanks and apologies again for the delay

Phil