[libbeat] dns processor cache configuration is ignored
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 15m
- Merged PRs (30d)
- 385
Description
Configuring the cache for the dns processor doesn't work. The reason for this is that the [respective embedded config struct](https://github.com/elastic/beats/blob/04eac62055e90992704e1d45fa580162f01c0d9b/libbeat/processors/dns/config.go#L33) is private. As a result, ucfg's unpack logic ignores it.
For confirmed bugs, please report:
- Version: Literally all versions.
- Operating System: Linux
- Steps to Reproduce: The following unit test reproduces the problem:
```golang
func TestCacheConfig(t *testing.T) {
cacheCfgYaml := `
type: A
success_cache:
min_ttl: 10m
`
cacheCfgC, err := conf.NewConfigFrom(cacheCfgYaml)
require.NoError(t, err)
dnsConf := defaultConfig()
err = cacheCfgC.Unpack(&dnsConf)
require.NoError(t, err)
assert.Equal(t, 10*time.Minute, dnsConf.SuccessCache.MinTTL)
}
```
Contributor guide
Research direction
Start in libbeat/processors/dns/config.go at the embedded cache configuration described in the issue, then run the provided TestCacheConfig reproducer. Done means the YAML success_cache.min_ttl value is unpacked into dnsConf.SuccessCache.MinTTL as 10 minutes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100