github.com/influxdata/telegraf@v1.30.3/config/testdata/envvar_comments_expected.toml (about) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 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 = '#' 32 setting2 = '''#''' 33 setting3 = "#" 34 setting4 = """#""" 35 wicked1 = "\"" 36 wicked2 = """\"""" 37 38 [[inputs.cpu]] 39 percpu = true 40 41 42 43 44 [[a.plugin]] 45 mylist = [ 46 "value 1", 47 "value 2", 48 "value 3", "value 4", 49 'value5', """tagwith#value""", 50 ] 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 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 '''