I am trying to collect Bitbucket API data as a json file and push the data to InfluxDB. I am doing this via Jenkins scripted pipeline. I am not sure how to convert my json data to points as the data will be dynamic. The script executes without any error but I am unable to see my data in InfluxDB How can I specify which measurement to use.
Code is as below
import groovy.json.*
def result
influxSRV='x.x.x.x:8086'
influxDb='dbname'
measurement = 'ms'
node('master'){
stage('collect'){
sh "curl -XGET -u 'xx:yy' https://x.y.z > output.json"
result = readJSON file: 'output.json'
sh "curl -iX POST \'http://${influxSRV}/write?db=${influxDb}&precision=ms\' --data-binary \'${measurement},${result}\'"
}
}
But the data is not uploaded. Can anyone let me know what I am missing?