You can use the log parser plugin
EDIT: Excerpt from the plugin's documentation
Job Configuration Go to menu: Jenkins -> job name -> Configure Go to section : Post-build Actions Check the "Console output (build log) parsing" checkbox. "Mark build Unstable on Warning" option: check to have parsed warnings mark the build 'unstable'. "Mark build Failed on Error" option : check to have parsed errors mark the build 'failed'. "Select Parsing Rules" : select the set of rules to use for parsing the logs of this job's builds (Notice that this list is derived from the global configuration )