tcp_metrics/tests/read.sh
2024-07-12 17:37:06 +02:00

13 lines
561 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/bash
curl -i -X POST "http://192.168.1.68:8086/api/v2/query?bucket=tcp_metrics&orgID=f32d493484526abc" \
--header "Authorization: Token $1" \
--header "Accept: application/csv" \
--header "Content-Type: application/vnd.flux" \
--data 'from(bucket: "tcp_metrics")
|> range(start: -5m)
|> filter(fn: (r) => r["_measurement"] == "tcp_reset")
|> filter(fn: (r) => r["host"] == "127.0.0.1")
|> filter(fn: (r) => r["_field"] == "value")
|> yield(name: "mean")'