influxdata / influxdata/telegraf
Telegraf config doesn't accept single quotes for table keys
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Relevant telegraf.conf
```toml
[global_tags]
Account = 'MyAccount'
"Key1" = 'Value1'
'my.key' = 'Value2'
[inputs]
[[inputs.cpu]]
...
```
### Logs from Telegraf
```text
2024-09-23T17:11:25Z I! Loading config: tgraf-test.conf
2024-09-23T17:11:25Z E! loading config file tgraf-test.conf failed: error parsing data: line 4: invalid TOML syntax
```
### System info
Telegraf 1.32.0 (git: HEAD@dcfadf8b)
### Docker
_No response_
### Steps to reproduce
1. Create the test config as provided
2. Run command to start telegraf. Command: telegraf --config
### Expected behavior
Telegraf should start without any error
### Actual behavior
Telegraf throws invalid TOML config as error
### Additional info
I've sample telegraf configuration that I'm using to start telegraf. Even though the configuration is a valid toml document, the telegraf doesn't seem to like it and keep complaining about the quotes around the table keys. I couldn't find any documentation around not being allowed to use quotes around the table keys. Is this a bug?
Contributor guide
Research direction
Start by reproducing the issue with the provided telegraf.conf and the telegraf --config entry point, then trace the TOML parsing path. Verify handling of the quoted keys under [global_tags] and ensure the configuration starts without an invalid TOML syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100