influxdata / influxdata/influxdb
Error 400 bad request
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
I try to make a shellscipt to send data to influx bad give me error 400, data are OK i made the same with python and is working
That is my code:
`
$measurement = 'disk_test'
$disks = Get-WmiObject Win32_LogicalDisk | Select-Object DeviceID, VolumeName, Size, FreeSpace, FileSystem
$data = @()
foreach ($disk in $disks) {
$point = @{
measurement = $measurement
tags = @{
Instance = $disk.DeviceID
Name = $disk.VolumeName
FileSystem = $disk.FileSystem
Host = $env:COMPUTERNAME
}
fields = @{
Size = $disk.Size
FreeSpace = $disk.FreeSpace
}
}
$jsonData = $data | ConvertTo-Json -Depth 100
Invoke-WebRequest 'http://192.168.1.100:8086/write?db=casadb_wintel' -Method POST -Body $jsonData
`
Thank you!
Contributor guide
Research direction
Start with the PowerShell script in the issue and inspect the JSON produced by ConvertTo-Json before it is sent to the InfluxDB write endpoint. Compare that request body and response with the working Python request; done when the script sends valid data and the endpoint no longer returns HTTP 400.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100