grep -v -e “*#” -e “^$” telegraf.config
[global_tags]
[agent]
interval = “20s”
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = “0s”
flush_interval = “20s”
flush_jitter = “0s”
precision = “”
debug = false
quiet = true
logfile = “”
hostname = “”
omit_hostname = false
[[outputs.influxdb]]
urls = [“http://xxxxxxx:8086”]
database = “telegraf” # required
retention_policy = “”
write_consistency = “any”
timeout = “5s”
username = “xxxxxxxxx”
password = “xxxxxxxxxx”
user_agent = “telegraf”
[[inputs.cpu]]
percpu = false
totalcpu = true
collect_cpu_time = true
[[inputs.disk]]
mount_points = [“/rootfs”,“/rootfs/data”]
ignore_fs = [“tmpfs”, “devtmpfs”, “devfs”]
[[inputs.diskio]]
devices = [“vda1”,“vdb1”]
[[inputs.mem]]
[[inputs.swap]]
[[inputs.docker]]
endpoint = “unix:///var/run/docker.sock”
container_names =
timeout = “10s”
perdevice = true
total = false
tagexclude = [“engine_host”, “memory_total”, “unit”, “container_image”, “container_version”]
fielddrop = [“max_usage”, “usage”, “fail_count”, “limit”, “total_pgmafault”, “cache”, “mapped_file”, “total_inactive_file”, “pgpgout”, “rss”, “total_mapped_file”, “writeback”, “unevictable”, “pgpgin”, “total_unevictable”, “pgmajfault”, “total_rss_huge”, “total_writeback”, “total_inactive_anon”, “rss_huge”, “hierarchical_memory_limit”, “total_pgfault”, “total_active_file”, “active_anon”, “total_active_anon”, “total_pgpgout”, “inactive_anon”, “active_file”, “pgfault”, “inactive_file”, “total_pgpgin”, “usage_percent”, “container_id”, “usage_system”, “throttling_periods”, “throttling_throttled_periods”, “throttling_throttled_time”, “memory_total”]
[[inputs.http_response]]
address = “https://xxxxxxxxxx”
response_timeout = “10s”
method = “GET”
follow_redirects = false
[[inputs.http_response]]
address = “https://yyyyyyyyyyy”
response_timeout = “10s”
method = “GET”
follow_redirects = false
[[inputs.mysql]]
servers = [“xxxxxxxx:yyyyyyyyy@tcp(zzzzzzzzz:3306)/”]
perf_events_statements_digest_text_limit = 120
perf_events_statements_limit = 250
perf_events_statements_time_limit = 86400
table_schema_databases = [“xxxxx”,“yyyyyy”]
gather_table_schema = true
gather_process_list = true
gather_user_statistics = false
gather_info_schema_auto_inc = false
gather_innodb_metrics = false
gather_slave_status = false
gather_binary_logs = false
gather_table_io_waits = false
gather_table_lock_waits = false
gather_index_io_waits = false
gather_event_waits = false
gather_file_events_stats = false
gather_perf_events_statements = false
interval_slow = “30m”
namedrop=[“info_schema_table_version”, “mysql_variables”]
taginclude=[“host”,“schema”,“table”,“user”]
fieldpass=[“value”, “aborted_connects”, “busy_time”, “bytes_received”, “bytes_sent”, “connection_errors_accept”, “connection_errors_internal”, “connection_errors_max_connections”, “connection_errors_peer_address”, “connection_errors_select”, “connection_errors_tcpwrap”, “connections”, “empty_queries”, “flush_commands”, “handler_commit”, “handler_delete”, “handler_read_first”, “handler_read_key”, “handler_update”, “handler_write”, “innodb_available_undo_logs”, “innodb_buffer_pool_pages_total”, “innodb_buffer_pool_read_requests”, “innodb_buffer_pool_reads”, “innodb_buffer_pool_write_requests”, “innodb_data_read”, “innodb_data_reads”, “innodb_data_writes”, “innodb_data_written”, “innodb_log_waits”, “innodb_log_write_requests”, “innodb_log_writes”, “innodb_num_open_files”, “innodb_num_pages_page_compressed”, “innodb_row_lock_current_waits”, “innodb_row_lock_time”, “innodb_row_lock_time_avg”, “innodb_row_lock_time_max”, “innodb_row_lock_waits”, “innodb_rows_deleted”, “innodb_rows_inserted”, “innodb_rows_read”, “innodb_rows_updated”, “max_statement_time_exceeded”, “max_used_connections”, “memory_used”, “open_files”, “open_tables”, “queries”, “rows_read”, “slow_launch_threads”, “slow_queries”, “threads_connected”, “threads_running”, “threads_altering_table”, “threads_executing”, “threads_idle”, “connections”]
[[inputs.nginx]]
urls = [“http://xxxxxxx/yyyyyyyyyy”]
[[inputs.logparser]]
files = [“/data/telegraf_logs/nginx/nginx.log”]
from_beginning = false
[inputs.logparser.grok]
patterns = [“^%{TIMESTAMP} %{DATA:nginx_host:tag} %{DATA:user_agent:tag} %{DATA:username:tag} %{DATA:method:tag} %{INT:status:tag} %{INT:request_len:int} %{INT:response_len:int} (?:%{NUMBER:gzip_ratio:float}|-) %{NUMBER:req_time:float} (?:%{NUMBER:upstream_time:float}|-) %{DATA:server_name:tag} %{DATA:website:tag}$”]
measurement = “nginx_logs”
custom_patterns = ‘’’
TIMESTAMP [%{HTTPDATE:ts:ts-httpd}]
‘’’