github.com/influxdata/telegraf@v1.30.3/config/testdata/envvar_comments.toml (about) 1 # Telegraf Configuration 2 # 3 # Telegraf is entirely plugin driven. All metrics are gathered from the 4 # declared inputs, and sent to the declared outputs. 5 # 6 # Plugins must be declared in here to be active. 7 # To deactivate a plugin, comment out the name and any variables. 8 # 9 # Use 'telegraf -config telegraf.conf -test' to see what metrics a config 10 # file would generate. 11 # 12 # Environment variables can be used anywhere in this config file, simply surround 13 # them with ${}. For strings the variable must be within quotes (ie, "${STR_VAR}"), 14 # for numbers and booleans they should be plain (ie, ${INT_VAR}, ${BOOL_VAR}) 15 16 [global_tags] 17 18 [agent] 19 interval = "10s" 20 round_interval = true 21 metric_batch_size = 1000 22 metric_buffer_limit = 10000 23 collection_jitter = "0s" 24 flush_interval = '10s' 25 flush_jitter = "0s" 26 precision = "" 27 hostname = '' 28 omit_hostname = false 29 30 [[outputs.influxdb]] 31 setting1 = '#'#test 32 setting2 = '''#'''#test 33 setting3 = "#"#test 34 setting4 = """#"""#test 35 wicked1 = "\""#test 36 wicked2 = """\""""#test 37 38 [[inputs.cpu]] 39 percpu = true 40 #totalcpu = true 41 # collect_cpu_time = false 42 ## report_active = false 43 44 [[a.plugin]] 45 mylist = [ 46 "value 1", # a good value 47 "value 2", # a better value 48 "value 3", "value 4", 49 'value5', """tagwith#value""", 50 ] # Should work 51 52 [[some.stuff]] 53 a = 'not a #comment' 54 b = '''not a #comment''' 55 c = "not a #comment" 56 d = """not a #comment""" 57 e = '''not a #comment containing "quotes"''' 58 f = '''not a #comment containing 'quotes'?''' 59 g = """not a #comment containing "quotes"?""" 60 61 # Issue #14237 62 [[inputs.myplugin]] 63 value = '''This isn't a #comment.''' 64 65 [[processors.starlark]] 66 script = """ 67 # Drop fields if they contain a string. 68 # 69 # Example Input: 70 # measurement,host=hostname a=1,b="somestring" 1597255410000000000 71 # 72 # Example Output: 73 # measurement,host=hostname a=1 1597255410000000000 74 75 def apply(metric): 76 for k, v in metric.fields.items(): 77 if type(v) == "string": 78 metric.fields.pop(k) 79 80 return metric 81 """ 82 83 [[processors.starlark]] 84 script = ''' 85 # Drop fields if they contain a string. 86 # 87 # Example Input: 88 # measurement,host=hostname a=1,b="somestring" 1597255410000000000 89 # 90 # Example Output: 91 # measurement,host=hostname a=1 1597255410000000000 92 93 def apply(metric): 94 for k, v in metric.fields.items(): 95 if type(v) == "string": 96 metric.fields.pop(k) 97 98 return metric 99 '''