### PostgreSQL TLS Configuration Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/postgresql/README.md Example of how to configure TLS/SSL options for a PostgreSQL connection string. ```shell host=localhost user=pgotest dbname=app_production sslmode=require sslkey=/etc/telegraf/key.pem sslcert=/etc/telegraf/cert.pem sslrootcert=/etc/telegraf/ca.pem ``` -------------------------------- ### Proxmox Example Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/proxmox/README.md This is an example of the metrics output format from the Proxmox input plugin. ```text proxmox,host=pxnode,node_fqdn=pxnode.example.com,vm_fqdn=vm1.example.com,vm_id=112,vm_name=vm1,vm_type=lxc cpuload=0.147998116735236,disk_free=4461129728i,disk_total=5217320960i,disk_used=756191232i,disk_used_percentage=14,disk_read_bytes=8604417024i,disk_write_bytes=2481549824i,net_in_bytes=1469711887i,net_out_bytes=58448585i,mem_free=1046827008i,mem_total=1073741824i,mem_used=26914816i,mem_used_percentage=2,status="running",swap_free=536698880i,swap_total=536870912i,swap_used=172032i,swap_used_percentage=0,uptime=1643793i 1595457277000000000 ``` -------------------------------- ### Configure the example input plugin Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/example/README.md Add this block to your Telegraf configuration file to enable the example plugin. ```toml # This is an example plugin [[inputs.example]] example_option = "example_value" ``` -------------------------------- ### View Example Plugin Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/supervisor/README.md Sample output format for supervisor_processes and supervisor_instance metrics. ```text supervisor_processes,group=ExampleGroup,id=supervisor,port=9001,process=ExampleProcess,source=localhost state=20i,uptime=75958i 1659786637000000000 supervisor_instance,id=supervisor,port=9001,source=localhost state=1i 1659786637000000000 ``` -------------------------------- ### Start Telegraf Service using net start Source: https://github.com/influxdata/telegraf/blob/master/docs/WINDOWS_SERVICE.md This command starts the Telegraf service using the Windows 'net start' command. Ensure the service name 'telegraf' matches your installation. ```shell > net start telegraf ``` -------------------------------- ### Basic Testcontainer Setup for PostgreSQL Source: https://github.com/influxdata/telegraf/blob/master/docs/INTEGRATION_TESTS.md Demonstrates setting up a PostgreSQL container for integration testing. Ensure the container image, exposed ports, environment variables, and a waiting strategy are defined. ```go servicePort := "5432" container := testutil.Container{ Image: "postgres:alpine", ExposedPorts: []string{servicePort}, Env: map[string]string{ "POSTGRES_HOST_AUTH_METHOD": "trust", }, WaitingFor: wait.ForAll( wait.ForLog("database system is ready to accept connections"), wait.ForListeningPort(servicePort), ), } require.NoError(t, container.Start(), "failed to start container") defer func() { require.NoError(t, container.Terminate(), "terminating container failed") }() ``` -------------------------------- ### PromQL Range Query Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/promql/README.md Example of configuring a range query to fetch metrics over a specified time period. Includes 'start', 'end', and 'step' parameters for time-series data. ```toml ## Range queries, multiple instances are allowed [[inputs.promql.range]] ## Fallback name of the resulting metrics to use as metric name in case ## the __name__ property of the query results is empty. # name = "promql" ## Query to execute query = 'prometheus_http_requests_total{job="prometheus"}' ## Range parameters relative to the gathering time with positive values ## refer to BEFORE and negative to AFTER the gathering time start = "5m" # end = "0s" step = "1m" ## Limit for the number of results returned by the server with zero ## meaning no limit # limit = 0 ``` -------------------------------- ### Get Telegraf Version Source: https://github.com/influxdata/telegraf/blob/master/cmd/telegraf/README.md Use this command to check the installed Telegraf binary version. ```bash telegraf version ``` -------------------------------- ### Example Configuration Source: https://github.com/influxdata/telegraf/blob/master/plugins/processors/ifname/README.md A minimal configuration example for the ifname processor, setting the source interface index tag and the destination interface name tag. ```toml [[processors.ifname]] tag = "ifIndex" dest = "ifName" ``` -------------------------------- ### Example Plugin Configuration with Labels Source: https://github.com/influxdata/telegraf/blob/master/config/README.md Shows how to add a 'labels' table to a plugin configuration to define key-value pairs for matching against command-line selectors. Labels are plain strings. ```toml [[inputs.cpu]] [inputs.cpu.labels] app = "payments" region = "us-east" env = "prod" ``` -------------------------------- ### Get Bridge Config Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/huebridge/README.md Example curl command to retrieve bridge configuration, including the bridge ID. ```bash curl -k https://
/api/config/0 ``` -------------------------------- ### Install Telegraf Service with Specific Config File Source: https://github.com/influxdata/telegraf/blob/master/docs/WINDOWS_SERVICE.md When installing Telegraf as a service, always specify the full path to the configuration file using the `--config` flag to prevent startup failures. This example shows the correct way to specify a custom config file path. ```shell > "C:\Program Files\Telegraf\telegraf.exe" --config "C:\MyConfigs\telegraf.conf" service install ``` -------------------------------- ### Example Disk I/O Utilization and Service Time Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/diskio/README.md This example shows disk I/O utilization (`io_util`), service time (`io_svctm`), and I/O await time (`io_await`) metrics for different disks. These values represent the percentage of time the disk was active, the service time per I/O operation, and the time spent waiting for I/O, respectively. ```text diskio,name=sda io_await:0.3317307692307692,io_svctm:0.07692307692307693,io_util:0.5329780146568954 1578326400000000000 diskio,name=sda1 io_await:0.3317307692307692,io_svctm:0.07692307692307693,io_util:0.5329780146568954 1578326400000000000 diskio,name=sda2 io_await:0.3317307692307692,io_svctm:0.07692307692307693,io_util:0.5329780146568954 1578326400000000000 ``` -------------------------------- ### Filter Windows Network Metrics with tagdrop Source: https://github.com/influxdata/telegraf/blob/master/config/README.md Use tagdrop to exclude specific network interface instances. This example prevents metrics from interfaces starting with 'isatap' or 'Local' from being collected. ```toml [[inputs.win_perf_counters]] [[inputs.win_perf_counters.object]] ObjectName = "Network Interface" Instances = ["*"] Counters = [ "Bytes Received/sec", "Bytes Sent/sec" ] Measurement = "win_net" # Do not send metrics where the Windows interface name (instance) begins with # 'isatap' or 'Local' [inputs.win_perf_counters.tagdrop] instance = ["isatap*", "Local*"] ``` -------------------------------- ### Example Varnish Metrics Output (Version 1) Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/varnish/README.md Shows a basic example of Varnish metrics collected by the plugin. ```text varnish,host=rpercy-VirtualBox,section=MAIN cache_hit=0i,cache_miss=0i,uptime=8416i 1462765437090957980 ``` -------------------------------- ### Load Time Library Source: https://github.com/influxdata/telegraf/blob/master/plugins/processors/starlark/README.md Load the time library for time-related functions such as parsing durations, getting the current time, and timezone validation. See time_date.star, time_duration.star, and time_timestamp.star for examples. ```Starlark load("time.star", "time") ``` -------------------------------- ### TOML Configuration Style Example Source: https://github.com/influxdata/telegraf/blob/master/docs/developers/SAMPLE_CONFIG.md Illustrates TOML configuration style with double-commented documentation and default values. ```toml ## This text describes what an the exchange_type option does. # exchange_type = "topic" ``` ```toml ## Brokers are the AMQP brokers to connect to. brokers = ["amqp://localhost:5672"] ``` ```toml ## What an exchange type is. # exchange_type = "topic" ``` ```toml ## Static routing key. Used when no routing_tag is set or as a fallback ## when the tag specified in routing tag is not found. ## example: routing_key = "telegraf" # routing_key = "" ``` ```toml ## If true, queue will be declared as an exclusive queue. # queue_exclusive = false ## If true, queue will be declared as an auto deleted queue. # queue_auto_delete = false ## Authentication credentials for the PLAIN auth_method. # username = "" # password = "" ``` -------------------------------- ### MQTT Consumer Configuration Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/mqtt_consumer/README.md Basic configuration for the MQTT consumer plugin, including server addresses, topics to subscribe to, and data format settings. This example demonstrates how to set up the plugin to consume data in a 'value' format. ```toml [[inputs.mqtt_consumer]] ## Broker URLs for the MQTT server or cluster. To connect to multiple ## clusters or standalone servers, use a separate plugin instance. ## example: servers = ["tcp://localhost:1883"] ## servers = ["ssl://localhost:1883"] ## servers = ["ws://localhost:1883"] servers = ["tcp://127.0.0.1:1883"] ## Topics that will be subscribed to. topics = [ "telegraf/+/cpu/23", ] ## Data format to consume. ## Each data format has its own unique set of configuration options, read ## more about them here: ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md data_format = "value" data_type = "float" [[inputs.mqtt_consumer.topic_parsing]] topic = "telegraf/one/cpu/23" measurement = "_/_/measurement/_" tags = "tag/_/_/_" fields = "_/_/_/test" [inputs.mqtt_consumer.topic_parsing.types] test = "int" ``` -------------------------------- ### Printer Secret Store Plugin Implementation Source: https://github.com/influxdata/telegraf/blob/master/docs/SECRETSTORES.md Implements the Telegraf SecretStore interface for a 'Printer' plugin. This example demonstrates Get, Set, List, and GetResolver methods, and registers the plugin using secretstores.Add. ```go //go:generate ../../../tools/readme_config_includer/generator package main import ( _ "embed" "errors" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/plugins/secretstores" ) //go:embed sample.conf var sampleConfig string type Printer struct { Log telegraf.Logger `toml:"-"` cache map[string]string } func (p *Printer) SampleConfig() string { return sampleConfig } func (p *Printer) Init() error { return nil } // Get searches for the given key and return the secret func (p *Printer) Get(key string) ([]byte, error) { v, found := p.cache[key] if !found { return nil, errors.New("not found") } return []byte(v), nil } // Set sets the given secret for the given key func (p *Printer) Set(key, value string) error { p.cache[key] = value return nil } // List lists all known secret keys func (p *Printer) List() ([]string, error) { keys := make([]string, 0, len(p.cache)) for k := range p.cache { keys = append(keys, k) } return keys, nil } // GetResolver returns a function to resolve the given key. func (p *Printer) GetResolver(key string) (telegraf.ResolveFunc, error) { resolver := func() ([]byte, bool, error) { s, err := p.Get(key) return s, false, err } return resolver, nil } // Register the secret store on load. func init() { secretstores.Add("printer", func(string) telegraf.SecretStore { return &Printer{} }) } ``` -------------------------------- ### View Example Plugin Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/net_response/README.md Sample metrics generated by the plugin showing success, connection failure, and read failure states. ```text net_response,port=8086,protocol=tcp,result=success,server=localhost response_time=0.000092948,result_code=0i,result_type="success" 1525820185000000000 net_response,port=8080,protocol=tcp,result=connection_failed,server=localhost result_code=2i,result_type="connection_failed" 1525820088000000000 net_response,port=8080,protocol=udp,result=read_failed,server=localhost result_code=3i,result_type="read_failed",string_found=false 1525820088000000000 ``` -------------------------------- ### Get Host IP using curl and jq Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/kubernetes/README.md Example command to retrieve the IP address of the host running a pod, using curl to query the Kubernetes API and jq to parse the JSON response. Requires API URL, pod namespace, and pod hostname to be set as environment variables. ```sh curl -s $API_URL/api/v1/namespaces/$POD_NAMESPACE/pods/$HOSTNAME \ --header "Authorization: Bearer $TOKEN" \ --insecure | jq -r '.status.hostIP' ``` -------------------------------- ### Node Configuration using Namespace Index (Equivalent) Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/opcua_listener/README.md This configuration using a namespace index is equivalent to the Namespace URI example, demonstrating the simpler but potentially less stable method. ```toml [[inputs.opcua_listener.nodes]] name = "ServerStatus" namespace = "0" identifier_type = "i" identifier = "2256" ``` -------------------------------- ### JSONv2 Format Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/serializers/nowmetric/README.md Example of the JSONv2 format using a records object. ```json { "records": [ { "metric_type": "Disk C: % Free Space", "resource": "C:\\", "node": "lnux100", "value": 50, "timestamp": 1473183012000, "ci2metric_id": { "node": "lnux100" }, "source": "Telegraf" } ] } ``` -------------------------------- ### Telegraf Metric Input Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/zabbix/README.md Example of a standard Telegraf metric measurement. ```text measurement,host=hostname valueA=0,valueB=1 ``` -------------------------------- ### Example Windows Services Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/win_services/README.md This is an example of the metrics collected for Windows services, showing the state and startup mode. ```text win_services,host=WIN2008R2H401,display_name=Server,service_name=LanmanServer state=4i,startup_mode=2i 1500040669000000000 win_services,display_name=Remote\ Desktop\ Services,service_name=TermService,host=WIN2008R2H401 state=1i,startup_mode=3i 1500040669000000000 ``` -------------------------------- ### Libvirt Plugin Example Configuration Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/libvirt/README.md A specific configuration example for the libvirt plugin, specifying domain names, the libvirt URI, enabled metrics, and additional statistics to collect. ```toml [[inputs.libvirt]] domain_names = ["ubuntu_20"] libvirt_uri = "qemu:///system" libvirt_metrics = ["state", "interface"] additional_statistics = ["vcpu_mapping"] ``` -------------------------------- ### Modbus Example Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/modbus/README.md An example of the metric output generated by the Modbus plugin. ```text modbus,name=device,slave_id=1,type=holding_register energy=3254.5,power=23.5,frequency=49,97 1701777274026591864 ``` -------------------------------- ### LVM Input Plugin Example Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/lvm/README.md Sample output demonstrating metrics collected for physical volumes, volume groups, and logical volumes, including details on size, free space, and usage percentages. ```text lvm_physical_vol,path=/dev/sda2,vol_group=vgroot free=0i,size=249510756352i,used=249510756352i,used_percent=100 1631823026000000000 lvm_physical_vol,path=/dev/sdb,vol_group=docker free=3858759680i,size=128316342272i,used=124457582592i,used_percent=96.99277612525741 1631823026000000000 lvm_vol_group,name=vgroot free=0i,logical_volume_count=1i,physical_volume_count=1i,size=249510756352i,snapshot_count=0i,used_percent=100 1631823026000000000 lvm_vol_group,name=docker free=3858759680i,logical_volume_count=1i,physical_volume_count=1i,size=128316342272i,snapshot_count=0i,used_percent=96.99277612525741 1631823026000000000 lvm_logical_vol,name=lvroot,vol_group=vgroot data_percent=0,metadata_percent=0,size=249510756352i 1631823026000000000 lvm_logical_vol,name=thinpool,vol_group=docker data_percent=0.36000001430511475,metadata_percent=1.3300000429153442,size=121899057152i 1631823026000000000 ``` -------------------------------- ### Homie-v4 Layout Example Metrics Source: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/mqtt/README.md Example metrics demonstrating the 'homie-v4' layout format. ```text modbus,source=device\ 1,location=main\ building,type=Machine\ A,status=ok temperature=21.4,serial\ number="324nlk234r5u9834t",working\ hours=123i,supplied=true 1676522982000000000 modbus,source=device\ 2,location=main\ building,type=Machine\ B,status=offline supplied=false 1676522982000000000 modbus,source=device\ 2,location=main\ building,type=Machine\ B,status=online supplied=true,Throughput=12345i,Load\ [%]=81.2,account\ no="T3L3GrAf",Temperature=25.38,Voltage=24.1,Current=100 1676542982000000000 ``` -------------------------------- ### Field Layout Example Metrics Source: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/mqtt/README.md Example metrics demonstrating the 'field' layout format. ```text modbus,location=main\ building,source=device\ 1,status=ok,type=Machine\ A temperature=21.4,serial\ number="324nlk234r5u9834t",working\ hours=123i,supplied=true 1676522982000000000 modbus,location=main\ building,source=device\ 2,status=offline,type=Machine\ B temperature=25.0,supplied=true 1676522982000000000 ``` -------------------------------- ### vSphere Inventory Path Structure Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/vsphere/README.md Illustrates the tree-like structure of a vSphere inventory, showing how resources like datacenters, hosts, clusters, and VMs are organized. ```bash +-DC0 # Virtual datacenter +-datastore # Datastore folder (created by system) | +-Datastore1 +-host # Host folder (created by system) | +-Cluster1 | | +-Host1 | | | +-VM1 | | | +-VM2 | | | +-hadoop1 | | +-ResourcePool1 | | | +-VM3 | | | +-VM4 | +-Host2 # Dummy cluster created for non-clustered host | | +-Host2 | | | +-VM5 | | | +-VM6 +-vm # VM folder (created by system) | +-VM1 | +-VM2 | +-Folder1 | | +-hadoop1 | | +-NestedFolder1 | | | +-VM3 | | | +-VM4 ``` -------------------------------- ### Telegraf Metric with Tags Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/zabbix/README.md Example of a Telegraf metric containing additional tags. ```text measurement,host=hostname,tagA=keyA,tagB=keyB valueA=0,valueB=1 ``` -------------------------------- ### Example CPU Metrics Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/cpu/README.md Sample output showing the format of CPU metrics collected by the plugin. ```text cpu,cpu=cpu0,host=loaner time_active=202224.15999999992,time_guest=30250.35,time_guest_nice=0,time_idle=1527035.04,time_iowait=1352,time_irq=0,time_nice=169.28,time_softirq=6281.4,time_steal=0,time_system=40097.14,time_user=154324.34 1568760922000000000 cpu,cpu=cpu0,host=loaner usage_active=31.249999981810106,usage_guest=2.083333333080696,usage_guest_nice=0,usage_idle=68.7500000181899,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=4.166666666161392,usage_user=25.000000002273737 1568760922000000000 cpu,cpu=cpu1,host=loaner time_active=201890.02000000002,time_guest=30508.41,time_guest_nice=0,time_idle=264641.18,time_iowait=210.44,time_irq=0,time_nice=181.75,time_softirq=4537.88,time_steal=0,time_system=39480.7,time_user=157479.25 1568760922000000000 cpu,cpu=cpu1,host=loaner usage_active=12.500000010610771,usage_guest=2.0833333328280585,usage_guest_nice=0,usage_idle=87.49999998938922,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=2.0833333332070145,usage_steal=0,usage_system=4.166666665656117,usage_user=4.166666666414029 1568760922000000000 cpu,cpu=cpu2,host=loaner time_active=201382.78999999998,time_guest=30325.8,time_guest_nice=0,time_idle=264686.63,time_iowait=202.77,time_irq=0,time_nice=162.81,time_softirq=3378.34,time_steal=0,time_system=39270.59,time_user=158368.28 1568760922000000000 cpu,cpu=cpu2,host=loaner usage_active=15.999999993480742,usage_guest=1.9999999999126885,usage_guest_nice=0,usage_idle=84.00000000651926,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=2.0000000002764864,usage_steal=0,usage_system=3.999999999825377,usage_user=7.999999998923158 1568760922000000000 cpu,cpu=cpu3,host=loaner time_active=198953.51000000007,time_guest=30344.43,time_guest_nice=0,time_idle=265504.09,time_iowait=187.64,time_irq=0,time_nice=197.47,time_softirq=2301.47,time_steal=0,time_system=39313.73,time_user=156953.2 1568760922000000000 cpu,cpu=cpu3,host=loaner usage_active=10.41666667424579,usage_guest=0,usage_guest_nice=0,usage_idle=89.58333332575421,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=4.166666666666667,usage_user=6.249999998484175 1568760922000000000 cpu,cpu=cpu-total,host=loaner time_active=804450.5299999998,time_guest=121429,time_guest_nice=0,time_idle=2321866.96,time_iowait=1952.86,time_irq=0,time_nice=711.32,time_softirq=16499.1,time_steal=0,time_system=158162.17,time_user=627125.08 1568760922000000000 cpu,cpu=cpu-total,host=loaner usage_active=17.616580305880305,usage_guest=1.036269430422946,usage_guest_nice=0,usage_idle=82.3834196941197,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=1.0362694300459534,usage_steal=0,usage_system=4.145077721691784,usage_user=11.398963731636465 1568760922000000000 ``` -------------------------------- ### Example Redfish Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/redfish/README.md This is an example of the metric output generated by the Redfish input plugin. ```text redfish_thermal_temperatures,address=127.0.0.1,chassis_chassistype=RackMount,chassis_health=OK,chassis_manufacturer=Contoso,chassis_model=3500RX,chassis_partnumber=224071-J23,chassis_powerstate=On,chassis_serialnumber=437XR1138R2,chassis_sku=8675309,chassis_state=Enabled,health=OK,member_id=2,name=Chassis\ Intake\ Temp,rack=WEB43,row=North,source=web483,state=Enabled lower_threshold_critical=5,lower_threshold_fatal=0,reading_celsius=25,upper_threshold_critical=40,upper_threshold_fatal=50 1691270170000000000 ``` -------------------------------- ### Configure Processor Plugin Order and Transformations Source: https://github.com/influxdata/telegraf/blob/master/config/README.md Example demonstrating how to set the execution order for processor plugins and configure specific transformations like renaming tags and trimming prefixes. ```toml [[processors.rename]] order = 1 [[processors.rename.replace]] tag = "path" dest = "resource" [[processors.strings]] order = 2 [[processors.strings.trim_prefix]] tag = "resource" prefix = "/api/" ``` -------------------------------- ### Statsd Counter Examples Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/statsd/README.md Examples of counter formats, including increments and sampled rates. ```plaintext deploys.test.myservice:1|c ``` ```plaintext deploys.test.myservice:101|c ``` ```plaintext deploys.test.myservice:1|c|@0.1 ``` -------------------------------- ### vSAN Configuration Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/vsphere/README.md This TOML configuration shows how to set up the vSphere input plugin to collect vSAN metrics. It includes basic connection details, excludes most other metrics, and specifies a comprehensive list of vSAN metrics to include. ```toml [[inputs.vsphere]] interval = "300s" vcenters = ["https:///sdk", "https:///sdk"] username = "" password = "" # Exclude all other metrics vm_metric_exclude = ["*"] datastore_metric_exclude = ["*"] datacenter_metric_exclude = ["*"] host_metric_exclude = ["*"] cluster_metric_exclude = ["*"] # By default all supported entity will be included vsan_metric_include = [ "summary.disk-usage", "summary.health", "summary.resync", "performance.cluster-domclient", "performance.cluster-domcompmgr", "performance.host-domclient", "performance.host-domcompmgr", "performance.cache-disk", "performance.disk-group", "performance.capacity-disk", "performance.disk-group", "performance.virtual-machine", "performance.vscsi", "performance.virtual-disk", "performance.vsan-host-net", "performance.vsan-vnic-net", "performance.vsan-pnic-net", "performance.vsan-iscsi-host", "performance.vsan-iscsi-target", "performance.vsan-iscsi-lun", "performance.lsom-world-cpu", "performance.nic-world-cpu", "performance.dom-world-cpu", "performance.cmmds-world-cpu", "performance.host-cpu", "performance.host-domowner", "performance.host-memory-slab", "performance.host-memory-heap", "performance.system-mem", ] # by default vsan_metric_skip_verify = false vsan_metric_skip_verify = true vsan_metric_exclude = [ ] # vsan_cluster_include = [ "/*/host/**" ] # Inventory path to clusters to collect (by default all are collected) collect_concurrency = 5 discover_concurrency = 5 ## Optional SSL Config # ssl_ca = "/path/to/cafile" # ssl_cert = "/path/to/certfile" # ssl_key = "/path/to/keyfile" ## Use SSL but skip chain & host verification # insecure_skip_verify = false ``` -------------------------------- ### Configure Filepath Processor Source: https://github.com/influxdata/telegraf/blob/master/plugins/processors/filepath/README.md Example configuration showing available path manipulation functions. ```toml # Performs file path manipulations on tags and fields [[processors.filepath]] ## Treat the tag value as a path and convert it to its last element, storing the result in a new tag # [[processors.filepath.basename]] # tag = "path" # dest = "basepath" ## Treat the field value as a path and keep all but the last element of path, typically the path's directory # [[processors.filepath.dirname]] # field = "path" ## Treat the tag value as a path, converting it to its the last element without its suffix # [[processors.filepath.stem]] # tag = "path" ## Treat the tag value as a path, converting it to the shortest path name equivalent ## to path by purely lexical processing # [[processors.filepath.clean]] # tag = "path" ## Treat the tag value as a path, converting it to a relative path that is lexically ## equivalent to the source path when joined to 'base_path' # [[processors.filepath.rel]] # tag = "path" # base_path = "/var/log" ## Treat the tag value as a path, replacing each separator character in path with a '/' character. Has only ## effect on Windows # [[processors.filepath.toslash]] # tag = "path" ``` -------------------------------- ### OpenSMTPD Plugin Example Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/opensmtpd/README.md Example of metrics collected by the OpenSMTPD input plugin. ```text opensmtpd,host=localhost scheduler_delivery_tempfail=822,mta_host=10,mta_task_running=4,queue_bounce=13017,scheduler_delivery_permfail=51022,mta_relay=7,queue_evpcache_size=2,scheduler_envelope_expired=26,bounce_message=0,mta_domain=7,queue_evpcache_update_hit=848,smtp_session_local=12294,bounce_envelope=0,queue_evpcache_load_hit=4389703,scheduler_ramqueue_update=0,mta_route=3,scheduler_delivery_ok=2149489,smtp_session_inet4=2131997,control_session=1,scheduler_envelope_incoming=0,uptime=10346728,scheduler_ramqueue_envelope=2,smtp_session=0,bounce_session=0,mta_envelope=2,mta_session=6,mta_task=2,scheduler_ramqueue_message=2,mta_connector=7,mta_source=1,scheduler_envelope=2,scheduler_envelope_inflight=2 1510220300000000000 ``` -------------------------------- ### NTPQ Example Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/ntpq/README.md An example of the output format generated by the ntpq input plugin. ```text ntpq,refid=.GPSs.,remote=*time.apple.com,stratum=1,type=u delay=91.797,jitter=3.735,offset=12.841,poll=64i,reach=377i,when=35i 1457960478909556134 ``` -------------------------------- ### Strings Processor Example Configuration Source: https://github.com/influxdata/telegraf/blob/master/plugins/processors/strings/README.md This example demonstrates a multi-step string processing configuration, applying lowercase, trim_prefix, and uppercase transformations sequentially. ```toml [[processors.strings]] [[processors.strings.lowercase]] tag = "uri_stem" [[processors.strings.trim_prefix]] tag = "uri_stem" prefix = "/api/" [[processors.strings.uppercase]] field = "cs-host" dest = "cs-host_normalised" ``` -------------------------------- ### Socket Writer Configuration Examples Source: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/socket_writer/README.md Demonstrates various address formats for TCP, UDP, and Unix sockets, including IPv4, IPv6, and vsock. Also shows optional TLS and keep-alive configurations. ```toml # Generic socket writer capable of handling multiple socket types. [[outputs.socket_writer]] ## URL to connect to # address = "tcp://127.0.0.1:8094" # address = "tcp://example.com:http" # address = "tcp4://127.0.0.1:8094" # address = "tcp6://127.0.0.1:8094" # address = "tcp6://[2001:db8::1]:8094" # address = "udp://127.0.0.1:8094" # address = "udp4://127.0.0.1:8094" # address = "udp6://127.0.0.1:8094" # address = "unix:///tmp/telegraf.sock" # address = "unixgram:///tmp/telegraf.sock" # address = "vsock://cid:port" ## Optional TLS Config # tls_ca = "/etc/telegraf/ca.pem" # tls_cert = "/etc/telegraf/cert.pem" # tls_key = "/etc/telegraf/key.pem" ## Use TLS but skip chain & host verification # insecure_skip_verify = false ## Period between keep alive probes. ## Only applies to TCP sockets. ## 0 disables keep alive probes. ## Defaults to the OS configuration. # keep_alive_period = "5m" ## Content encoding for message payloads, can be set to "gzip" or to ## "identity" to apply no encoding. ## # content_encoding = "identity" ## Data format to generate. ## Each data format has its own unique set of configuration options, read ## more about them here: ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md # data_format = "influx" ``` -------------------------------- ### Linux Sysctl Filesystem Example Output Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/linux_sysctl_fs/README.md An example of the output generated by the linux_sysctl_fs plugin. ```APIDOC ## Example Output ```text > linux_sysctl_fs,host=foo dentry-want-pages=0i,file-max=44222i,aio-max-nr=65536i,inode-preshrink-nr=0i,dentry-nr=64340i,dentry-unused-nr=55274i,file-nr=1568i,aio-nr=0i,inode-nr=35952i,inode-free-nr=12957i,dentry-age-limit=45i 1490982022000000000 ``` ``` -------------------------------- ### Install iputils-ping Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/ping/README.md Installs the iputils-ping package, which may be required for the 'exec' method on some systems. ```sh apt-get install iputils-ping ``` -------------------------------- ### PostgreSQL Databases Configuration Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/postgresql/README.md Example configuration for specifying a list of databases to collect metrics from. ```text databases = ["app_production", "testing"] ``` -------------------------------- ### Operational Intelligence Format Example Source: https://github.com/influxdata/telegraf/blob/master/plugins/serializers/nowmetric/README.md Example of the default Operational Intelligence JSON array format. ```json [ { "metric_type": "Disk C: % Free Space", "resource": "C:\\", "node": "lnux100", "value": 50, "timestamp": 1473183012000, "ci2metric_id": { "node": "lnux100" }, "source": "Telegraf" } ] ``` -------------------------------- ### Example Metric Source: https://github.com/influxdata/telegraf/blob/master/plugins/processors/regex/README.md This is an example metric used in the documentation to illustrate the effects of the regex processor configurations. ```text nginx_requests,verb=GET,resp_code=200 request="/api/search/?category=plugins&q=regex&sort=asc",referrer="-",ident="-",http_version=1.1,agent="UserAgent",client_ip="127.0.0.1",auth="-",resp_bytes=270i 1519652321000000000 ``` -------------------------------- ### Install and Use Parquet Reader CLI Source: https://github.com/influxdata/telegraf/blob/master/plugins/outputs/parquet/README.md Installs the Go CLI tool for reading and parsing Parquet files and demonstrates its basic usage. ```bash go install github.com/apache/arrow-go/v18/parquet/cmd/parquet_reader@latest parquet_reader ``` -------------------------------- ### Example Bond Input Plugin Configuration Source: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/bond/README.md This TOML configuration demonstrates how to set the 'host_proc' path and specify multiple bond interfaces for metric collection. This is useful for targeting specific network bonds. ```toml [[inputs.bond]] ## Sets 'proc' directory path ## If not specified, then default is /proc host_proc = "/proc" ## By default, telegraf gather stats for all bond interfaces ## Setting interfaces will restrict the stats to the specified ## bond interfaces. bond_interfaces = ["bond0", "bond1"] ```