[Python] 방화벽 로그 DB삽입
너무 대충 짠 코드 import pymysql import ipaddress from datetime import datetime import time import re conn = pymysql.connect(host='localhost', user='userID', password='1234', db='DB', charset='utf8') curs = conn.cursor() sql = "insert into firewall(date, fwrule, src_ip, src_mac, src_port, dst_ip, dst_port)\ values (%s, %s, %s, %s, %s, %s ,%s)" logfile_path = '로그파일경로' logfile_fullpath = logfile_path + '..
2020. 12. 8.