Hello everyone!
It seems like I need an advice on how to parse HAProxy logs and send them into Zabbix.
Below are two scripts which work fine, and I need them to work all together as one-line script.
1. Command to get query processing time from haproxy logs in real time:
tail -f haproxy.log | awk '{print $10}' | cut -d/ -f4
2. Command to send one value into zabbix.
echo "- haproxy.app.processing.time 1234"|zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file - -vv
I suppose it should be some trick with pipes there to link them together, and that is where I need help. Please advice.
Thank you in advance!
It seems like I need an advice on how to parse HAProxy logs and send them into Zabbix.
Below are two scripts which work fine, and I need them to work all together as one-line script.
1. Command to get query processing time from haproxy logs in real time:
tail -f haproxy.log | awk '{print $10}' | cut -d/ -f4
2. Command to send one value into zabbix.
echo "- haproxy.app.processing.time 1234"|zabbix_sender --config /etc/zabbix/zabbix_agentd.conf --input-file - -vv
I suppose it should be some trick with pipes there to link them together, and that is where I need help. Please advice.
Thank you in advance!
Comment