Anomaly detection

In machine learning anomaly detection, can I set my own rules for detection?
Example: I want to detect a computer. Normally this computer accesses many different IP addresses, but suddenly one day this computer accesses a completely new IP address compared to the previous addresses. The previous IP it accessed. So for this action, this is abnormal, but I want to set this rule so that machine learning does not identify this as abnormal->normal.

What should I do?