|
8046 | 8046 | # # content_encoding = "identity" |
8047 | 8047 |
|
8048 | 8048 |
|
| 8049 | +# # Read metrics from SQL queries |
| 8050 | +# [[inputs.sql]] |
| 8051 | +# ## Database Driver |
| 8052 | +# ## See https://github.com/influxdata/telegraf/blob/master/docs/SQL_DRIVERS_INPUT.md for |
| 8053 | +# ## a list of supported drivers. |
| 8054 | +# driver = "mysql" |
| 8055 | +# |
| 8056 | +# ## Data source name for connecting |
| 8057 | +# ## The syntax and supported options depends on selected driver. |
| 8058 | +# dsn = "username:password@mysqlserver:3307/dbname?param=value" |
| 8059 | +# |
| 8060 | +# ## Timeout for any operation |
| 8061 | +# # timeout = "5s" |
| 8062 | +# |
| 8063 | +# ## Connection time limits |
| 8064 | +# ## By default the maximum idle time and maximum lifetime of a connection is unlimited, i.e. the connections |
| 8065 | +# ## will not be closed automatically. If you specify a positive time, the connections will be closed after |
| 8066 | +# ## idleing or existing for at least that amount of time, respectively. |
| 8067 | +# # connection_max_idle_time = "0s" |
| 8068 | +# # connection_max_life_time = "0s" |
| 8069 | +# |
| 8070 | +# ## Connection count limits |
| 8071 | +# ## By default the number of open connections is not limited and the number of maximum idle connections |
| 8072 | +# ## will be inferred from the number of queries specified. If you specify a positive number for any of the |
| 8073 | +# ## two options, connections will be closed when reaching the specified limit. The number of idle connections |
| 8074 | +# ## will be clipped to the maximum number of connections limit if any. |
| 8075 | +# # connection_max_open = 0 |
| 8076 | +# # connection_max_idle = auto |
| 8077 | +# |
| 8078 | +# [[inputs.sql.query]] |
| 8079 | +# ## Query to perform on the server |
| 8080 | +# query="SELECT user,state,latency,score FROM Scoreboard WHERE application > 0" |
| 8081 | +# ## Alternatively to specifying the query directly you can select a file here containing the SQL query. |
| 8082 | +# ## Only one of 'query' and 'query_script' can be specified! |
| 8083 | +# # query_script = "/path/to/sql/script.sql" |
| 8084 | +# |
| 8085 | +# ## Name of the measurement |
| 8086 | +# ## In case both measurement and 'measurement_col' are given, the latter takes precedence. |
| 8087 | +# # measurement = "sql" |
| 8088 | +# |
| 8089 | +# ## Column name containing the name of the measurement |
| 8090 | +# ## If given, this will take precedence over the 'measurement' setting. In case a query result |
| 8091 | +# ## does not contain the specified column, we fall-back to the 'measurement' setting. |
| 8092 | +# # measurement_column = "" |
| 8093 | +# |
| 8094 | +# ## Column name containing the time of the measurement |
| 8095 | +# ## If ommited, the time of the query will be used. |
| 8096 | +# # time_column = "" |
| 8097 | +# |
| 8098 | +# ## Format of the time contained in 'time_col' |
| 8099 | +# ## The time must be 'unix', 'unix_ms', 'unix_us', 'unix_ns', or a golang time format. |
| 8100 | +# ## See https://golang.org/pkg/time/#Time.Format for details. |
| 8101 | +# # time_format = "unix" |
| 8102 | +# |
| 8103 | +# ## Column names containing tags |
| 8104 | +# ## An empty include list will reject all columns and an empty exclude list will not exclude any column. |
| 8105 | +# ## I.e. by default no columns will be returned as tag and the tags are empty. |
| 8106 | +# # tag_columns_include = [] |
| 8107 | +# # tag_columns_exclude = [] |
| 8108 | +# |
| 8109 | +# ## Column names containing fields (explicit types) |
| 8110 | +# ## Convert the given columns to the corresponding type. Explicit type conversions take precedence over |
| 8111 | +# ## the automatic (driver-based) conversion below. |
| 8112 | +# ## NOTE: Columns should not be specified for multiple types or the resulting type is undefined. |
| 8113 | +# # field_columns_float = [] |
| 8114 | +# # field_columns_int = [] |
| 8115 | +# # field_columns_uint = [] |
| 8116 | +# # field_columns_bool = [] |
| 8117 | +# # field_columns_string = [] |
| 8118 | +# |
| 8119 | +# ## Column names containing fields (automatic types) |
| 8120 | +# ## An empty include list is equivalent to '[*]' and all returned columns will be accepted. An empty |
| 8121 | +# ## exclude list will not exclude any column. I.e. by default all columns will be returned as fields. |
| 8122 | +# ## NOTE: We rely on the database driver to perform automatic datatype conversion. |
| 8123 | +# # field_columns_include = [] |
| 8124 | +# # field_columns_exclude = [] |
| 8125 | + |
| 8126 | + |
8049 | 8127 | # # Read metrics from Microsoft SQL Server |
8050 | 8128 | # [[inputs.sqlserver]] |
8051 | 8129 | # ## Specify instances to monitor with a list of connection strings. |
|
0 commit comments