New to mtail and need basic help

Skip to first unread message

Saveetha Rudramoorthy

Aug 30, 2019, 1:37:10 AM8/30/19
to mtail-users

 I have following sample statistics which need to be injected into Prometheus. 

"Connection_errors_tcpwrap": 0,
"Connections": 234,
"Delayed_insert_threads": 0,
"Innodb_buffer_pool_dump_status": "Dumping",
"Innodb_buffer_pool_load_status": "Buffer",
"Innodb_buffer_pool_resize_status": "",
"Innodb_buffer_pool_pages_data": 1802,
"Innodb_buffer_pool_bytes_data": 29523968

 I need entire statistics to be sent in the same form to Prometheus. Ex: "Connections": 234, "Delayed_insert_threads": 0 etc. 

 Can mtail be used for this scenario? If yes, what could be my program look like? Also, What would be the approach to scrap few other elements from other files? Will i be able to run multiple programs?

thanks and regards,

Jamie Wilkinson

Aug 30, 2019, 8:00:58 AM8/30/19
to Saveetha Rudramoorthy, mtail-users
Do these statistics get appended to a log file continuously?  If yes, then mtail would be useful.  If it's JSON that's just being overwritten every time, I think this tool might be better:

Do you know the names of all the stats or are they likely to change?  If yes they never change, then mtail will work for you.

Yes, you can run multiple programs in one mtail.  But right now every program reads every file so you can get some weird behaviour sometimes, though there's a way to avoid that.

A simple mtail program would look like:

counter Connections

/"Connections": (\d+),/ {
  Connections = $1
and repeat for the other stat names.

You received this message because you are subscribed to the Google Groups "mtail-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages