Search code examples
jenkinsjenkins-plugins

Jenkins: Log parser Plugin Error: Cannot parse log: Can't read parsing rules file


i put my parsing rules file in:

/var/lib/jenkins/jobs/Wireshark/parsing_rules.txt

in the jenkins configuration, where i have to set the path to my parsing file, i set the same path. But the Plugin can not find the file. It is only returning this error:

log-parser plugin ERROR: Cannot parse log: Can't read parsing rules file: /var/lib/jenkins/jobs/Wireshark/parsing_rules.txt 

The content of the file is:

warn /| Failure/
ok /| Ok/

Can someone help me solving this error?


Solution

  • TL:DR: Jenkins log parser files must be placed on the master, not slaves.

    You are placing the parsing log rules file in the jobs folder: /var/lib/jenkins/jobs/Wireshark/parsing_rules.txt

    Are you expecting Jenkins to find it on the slave? Jenkins looks for the file at the specifed path on the master not the slave, because the job's log parsing is performed on the master, not the slave.

    You may define multiple parsers so you can have different parsers for different jobs.

    You add each parser to the Configure System page, and in the job configuration, select the log parser you wish to parse your console log.