Skip to content

Commit

Permalink
feat(examples): modify some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zipper-meng authored and Icera Mag committed Jul 25, 2023
1 parent 50b64e0 commit 97d2d7c
Show file tree
Hide file tree
Showing 7 changed files with 8,387 additions and 88 deletions.
19 changes: 11 additions & 8 deletions examples/cnosdb_in.toml → examples/cnosdb_sub_influxdb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ omit_hostname = false
## or "gosmi" which translates using the built-in gosmi library.
# snmp_translator = "netsnmp"

# Generic socket listener capable of handling multiple socket types.
[[inputs.cnosdb]]
## URL to listen on
service_address = ":8081"

[[outputs.file]]
## Files to write to, "stdout" is a specially handled file.
files = ["/tmp/test_telegraf.out"]

service_address = ":8803"

[[outputs.http]]
url = "http://127.0.0.1:8086/write?db=telegraf"
timeout = "5s"
method = "POST"
username = ""
password = ""
data_format = "influx"
use_batch_format = true
content_encoding = "identity"
idle_conn_timeout = 10
72 changes: 13 additions & 59 deletions examples/prometheus.toml → examples/cnosdb_sub_tdengine.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,62 +97,16 @@ omit_hostname = false
## or "gosmi" which translates using the built-in gosmi library.
# snmp_translator = "netsnmp"

# Generic HTTP write listener
[[inputs.http_listener_v2]]
## Address and port to host HTTP listener on
service_address = ":8080"

## Paths to listen to.
paths = ["/remote_write"]

## Save path as http_listener_v2_path tag if set to true
# path_tag = false

## HTTP methods to accept.
# methods = ["POST", "PUT"]

## maximum duration before timing out read of the request
# read_timeout = "10s"
## maximum duration before timing out write of the response
# write_timeout = "10s"

## Maximum allowed http request body size in bytes.
## 0 means to use the default of 524,288,000 bytes (500 mebibytes)
# max_body_size = "500MB"

## Part of the request to consume. Available options are "body" and
## "query".
# data_source = "body"

## Set one or more allowed client CA certificate file names to
## enable mutually authenticated TLS connections
# tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]

## Add service certificate and key
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"

## Minimal TLS version accepted by the server
# tls_min_version = "TLS12"

## Optional username and password to accept for HTTP basic authentication.
## You probably want to make sure you have TLS configured above for this.
# basic_username = "foobar"
# basic_password = "barfoo"

## Optional setting to map http headers into tags
## If the http header is not present on the request, no corresponding tag will be added
## If multiple instances of the http header are present, only the first value will be used
# http_header_tags = {"HTTP_HEADER" = "TAG_NAME"}

## 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 = "prometheusremotewrite"

[[outputs.cnosdb]]
url = "localhost:31006"
user = "user"
password = "pass"
database = "telegraf"
[[inputs.cnosdb]]
service_address = ":8803"

[[outputs.http]]
url = "http://127.0.0.1:6041/influxdb/v1/write?db=telegraf"
timeout = "5s"
method = "POST"
username = "root"
password = "taosdata"
data_format = "influx"
use_batch_format = true
content_encoding = "identity"
idle_conn_timeout = 10
16 changes: 10 additions & 6 deletions examples/kafka.toml → examples/kafka_to_cnosdb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,13 @@ max_message_len = 1000000
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
data_format = "json"

[[outputs.cnosdb]]
url = "localhost:31006"
user = "user"
password = "pass"
database = "telegraf"

[[outputs.http]]
url = "http://127.0.0.1:8902/api/v1/write?db=telegraf"
timeout = "5s"
method = "POST"
username = "root"
password = "root"
data_format = "influx"
use_batch_format = true
content_encoding = "identity"
idle_conn_timeout = 10
15 changes: 10 additions & 5 deletions examples/mqtt.toml → examples/mqtt_to_cnosdb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ fields = ""
# [[inputs.mqtt_consumer.topic.types]]
# key = type

[[outputs.cnosdb]]
url = "localhost:31006"
user = "user"
password = "pass"
database = "telegraf"
[[outputs.http]]
url = "http://127.0.0.1:8902/api/v1/write?db=telegraf"
timeout = "5s"
method = "POST"
username = "root"
password = "root"
data_format = "influx"
use_batch_format = true
content_encoding = "identity"
idle_conn_timeout = 10
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ data_format = "opentsdbtelnet"
## Note: This setting is only used for splitting_strategy = "variable length".
# splitting_length_field = {offset = 0, bytes = 0, endianness = "be", header_length = 0}

[[outputs.cnosdb]]
url = "localhost:31006"
user = "user"
password = "pass"
database = "telegraf"
[[outputs.http]]
url = "http://127.0.0.1:8902/api/v1/write?db=telegraf"
timeout = "5s"
method = "POST"
username = "root"
password = "root"
data_format = "influx"
use_batch_format = true
content_encoding = "identity"
idle_conn_timeout = 10

16 changes: 11 additions & 5 deletions examples/opentsdb.toml → examples/opentsdb_to_cnosdb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,14 @@ data_format = "opentsdb"

high_priority_io = true

[[outputs.cnosdb]]
url = "localhost:31006"
user = "user"
password = "pass"
database = "telegraf"
[[outputs.http]]
url = "http://127.0.0.1:8902/api/v1/write?db=telegraf"
timeout = "5s"
method = "POST"
username = "root"
password = "root"
data_format = "influx"
use_batch_format = true
content_encoding = "identity"
idle_conn_timeout = 10

Loading

0 comments on commit 97d2d7c

Please sign in to comment.