If you are not “cleaning” eventlog you can try to use db query directly.
select device_id,message,reference from eventlog where device_id = XXX AND type = ‘interface’ AND UNIX_TIMESTAMP(datetime) >= UNIX_TIMESTAMP(NOW() - INTERVAL 365 DAY);
“Reference” will be the port_id. I suppose you can easily script this.
Maybe you will get some more info by looking at this topic: