6 Replies Latest reply on May 14, 2018 11:32 PM by LucD

    Write Points from file to InfluxDB using Invoke-RestMethod

    AmoghMaheshvip Novice

      With respect to Writing data with the HTTP API | InfluxData Documentation we can use curl to post multiple points from file to insert to influxdb

      [ curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary @cpu_data.txt ]

       

      As I am using PowerCLI script to post points to influxdb using

      [ Invoke-RestMethod -Uri 'http://localhost:8086/write?&db=DBName' -Method Post -Body "measurement-name,tag-name=tag-value value-name=value" ]

       

      I want know the similar syntax in Invoke-RestMethod to post from file.