Hi,
I have this file containing numbers of lines and my interest is only for one line which is "
capture.kernel_packets | RxPcapeth11 | 680". As you see, it has three culmons and I only need the third one so i used the command " root@ubuntu:~# tail -n53 '/var/log/suricata/stats.log'| grep 'capture.kernel_packets' | awk '/[0-9]/ {print $5}'" which prints out the value "680". however, when I try to import it to " /etc/zabbix/zabbix_agentd.conf" which the this command "UserParameter=suricata.packets[*],tail -n53 '/var/log/suricata/stats.log'| grep 'capture.kernel_packets' | awk '/[0-9]/ {print $5}'" it works fine but when i test it, it is presenting the the whole line as:
root@ubuntu:~# zabbix_agentd -t suricata.packets
suricata.packets[] [t|capture.kernel_packets | RxPcapeth11 | 680]
can anyone help me to only extract that number?
thanks
I have this file containing numbers of lines and my interest is only for one line which is "
capture.kernel_packets | RxPcapeth11 | 680". As you see, it has three culmons and I only need the third one so i used the command " root@ubuntu:~# tail -n53 '/var/log/suricata/stats.log'| grep 'capture.kernel_packets' | awk '/[0-9]/ {print $5}'" which prints out the value "680". however, when I try to import it to " /etc/zabbix/zabbix_agentd.conf" which the this command "UserParameter=suricata.packets[*],tail -n53 '/var/log/suricata/stats.log'| grep 'capture.kernel_packets' | awk '/[0-9]/ {print $5}'" it works fine but when i test it, it is presenting the the whole line as:
root@ubuntu:~# zabbix_agentd -t suricata.packets
suricata.packets[] [t|capture.kernel_packets | RxPcapeth11 | 680]
can anyone help me to only extract that number?
thanks
Or you want to use various parameters?
Comment