-
Notifications
You must be signed in to change notification settings - Fork 5
InfluxDB example
Daria Kharlan edited this page Nov 29, 2019
·
2 revisions
This is what we have in our InfluxDb instance.
> agent pipeline create
Choose source config (influx_source) [influx_source]:
Choose destination (http) [http]:
Pipeline ID (must be unique): influx_cpu
Measurement name: cpu
Value columns names: usage_active usage_idle
Target type (counter, gauge) [gauge]:
Dimensions: cpu host zone
Created pipeline influx_cpu
-
Measurement name: cpu
- here we type our measurement name (like a table) from which we want to select data -
Value columns names: usage_active usage_idle
- these are our value fields (we can have type multiple values here), they can only be numeric -
Dimensions: cpu host zone
- these are tag fields, they can only be of string type
From this input the query to InfluxDB is formed: SELECT "cpu"::tag,"host"::tag,"zone"::tag,"usage_active"::field,"usage_idle"::field FROM "cpu" WHERE "time" > {last_timestamp} LIMIT {limit}
.
Agent makes this query and transforms data it's received to Anodot metrics
[
{
"timestamp": 1555319249,
"properties": {
"target_type": "gauge",
"cpu": "cpu-total-usage",
"host": "msk-air-trn4",
"zone": "GF",
"measurement_category": "cpu",
"what": "usage_active"
},
"value": 0.94
},
{
"timestamp": 1555319249,
"properties": {
"target_type": "gauge",
"cpu": "cpu-total-usage",
"host": "msk-air-trn4",
"zone": "GF",
"measurement_category": "cpu",
"what": "usage_idle"
},
"value": 30.77
},
{
"timestamp": 1555319249,
"properties": {
"target_type": "gauge",
"cpu": "cpu-total-usage",
"host": "msk-air-trn0",
"zone": "GEO",
"measurement_category": "cpu",
"what": "usage_active"
},
"value": 0.2
},
{
"timestamp": 1555319249,
"properties": {
"target_type": "gauge",
"cpu": "cpu-total-usage",
"host": "msk-air-trn0",
"zone": "GEO",
"measurement_category": "cpu",
"what": "usage_idle"
},
"value": 92.6
}
]
This is example of an output which is sent to Anodot after running a pipeline with configuration above. Full file
- Home
- CLI reference
- API
- Kubernetes setup using Helm
- Podman setup
- Creating pipelines
- Test sources
- Data formats (JSON, CSV, AVRO, LOG)
- How to parse logs with grok patterns
- How to store sensitive information
- Automated pipelines creation
- Filtering
- Transformation files
- Fields
- DVP Configuration
- Integrations
- Sending events to Anodot