I've been working on writing a few company-specific modules for metricbeat and have a question about the best way to access the config.
I know that inside of the New func of a metricset module I can define a struct and pass it to base.Module().UnpackConfig() to get the config for that specific module. I've used that approach in the past to define custom settings. In this specific module I want to access the "period" configuration and I was wondering if that was already parsed somewhere else in beats.
Ideally I'd like to just receive the number of seconds in the interval regardless of what is defined in the config. Ex 300 vs 5m
I can write a parsing function but I don't want to duplicate code if it already exists somewhere else.