I followed MySQL module | Filebeat Reference [6.1] | Elastic to configure filebeat's module:
[root@7svdbm01 ~]# cat /etc/filebeat/modules.d/mysql.yml
- module: mysql
# Error logs
error:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/var/log/mariadb/mariadb.log"]
# Slow logs
slowlog:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/var/lib/mysql/7svdbm01-slow.log"]
[root@7svdbm01 ~]#
yet getting following error in elasticsearch's log:
[2017-12-27T21:31:24,312][DEBUG][o.e.a.b.TransportShardBulkAction] [filebeat-6.1.1-2017.12.27][0] failed to execute bulk item (index) BulkShardRequest [[filebeat-6.1.1-2017.12.27][0]] containing [index {[filebea
t-6.1.1-2017.12.27][doc][XbP1mmABalgviv2OvS2X], source[{"@timestamp":"2017-12-28T02:31:22.211Z","offset":7687579,"beat":{"hostname":"7svdbm01.uftwf.local","name":"7svdbm01.uftwf.local","version":"6.1.1"},"prospe
ctor":{"type":"log"},"source":"/var/lib/mysql/7svdbm01-slow.log","message":"# Time: 171227 21:31:19","fileset":{"module":"mysql","name":"slowlog"},"error":{"message":"Provided Grok expressions do not match field
value: [# Time: 171227 21:31:19]"}}]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [error]
.....
Caused by: java.lang.IllegalStateException: Can't get text on a START_OBJECT at 1:312
.....
It looks like has something to do with mapping, however template seems to be set fine:
# curl --silent --request GET elasticsearch:9200/_cat/templates/filebeat-*
filebeat-6.1.1 [filebeat-6.1.1-*] 1
filebeat-6.1.0 [filebeat-6.1.0-*] 1
#
Please advise.