What version of metricbeat are you using?
Did you run the metricbeat setup before starting to send metrics? You need to do it to have the correct mappings for your fields.
Maybe the problem is in the template name, you configured the setup with template pattern metricbeat-*, but your elasticsearch output is storing events in the metricbeat index, that doesn't match the pattern of the template, so even if the setup was done, the mapping is not being applied.
I'd recommend to use the default index names. Is there any reason you need to change them?
Having time-based index names is useful, for example if you want to remove old data you can just remove old indexes, also if you want to move old data to masters with slower disks (the hot-warm architecture), you can just move the old indexes.
Default indexes also have version information, this is also important as Beats of different versions may send events with different type mappings.
It is not possible to update the types of existing data, for that you need to create a new index and the proper mappings, and reindex.
In your case, if you want to keep your existing data you can try to directly reindex from your metricbeat index to an index whose name matches with the template pattern. And for new data I'd recommend to use the default names and patterns.
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.