I have written a custom beat lsbeat.yml (similar to the tutorial) and it works fine. I have a question on reading values from yml file.
I added a new property in the lsbeat.yml called
lastRunTimestamp: "2017-07-27 00:00:00"
Now how do I read the "lastRunTimestamp" property value from lsbeat.yml in the lsbeat.go file?
I tried to look for the code in libbeat directory for the code which reads output.elasticsearch property etc. from lsbeat.yml, but couldn't find anything solid except cfgfile_test.go file.
Note: I know to use "gopkg.in/yaml.v2" and get the properties. But I want to use something from beat framework itself. Hence the question.
Thanks Andrew for the response. I added the lastRunTimestamp in the config.go file like below
package config
import "time"
type Config struct {
Period time.Duration `config:"period"`
LastRunTimestamp string `config: "lastRunTimestamp"`
}
var DefaultConfig = Config{
Period: 60 * time.Second,
LastRunTimestamp: "2017-07-27 00:00:25",
}
But I only get the LastRunTimestamp value configured in the DefaultConfig (i.e., "2017-07-27 00:00:25")and not the value that I enter in the lsbeat.yml ("2017-07-27 00:00:00").
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.