let's assume you are looking for the "error" pattern in a log file. If you want EM to trigger a warning message when five or more ERROR entries are detected in a specific log file, then you can set the Warning Threshold to 4.
But where and how i set the pattern for monitoring
the pattern for monitoring is set via "Match Pattern in Perl" field ("Weblogic Server" drop-down menu > Monitoring > Metric and Collection Settings > View: All Metrics > Log File Monitoring)
You may find useful: note 1593028.1 and Overview of WebLogic Server and Application Deployment Log File Monitoring