I want to store the output of iptables -vL command into a mysql database table. When I run iptables -vL it shows usage in bytes along with users MAC id’s. I am planning to use awk to select two columns (usage “$2” and MAC id’s “$6”) from the output of the above command. And those two clomuns should go to the database. The usage column in the database should add up whenever the tables are updated.
I want to store the output of iptables -vL command into a mysql database
Share
When parsing the iptables output with awk, format it out as Mysql INSERT statements, and then pipe the results into the mysql command line. Something like: