Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Plugin Information

View Text Finder on the plugin site for more information.

This plugin lets you search for some text using regular expressions in a set of files or the console log. Once a match is found, you can downgrade a successful build to a status of unstable, failure, or not built.

For example, you can search for the string failure in a set of log files. If a match is found, you can downgrade the build from success to failure. This is handy when you have some tools in your build chain that don't properly set the exit code.

Note that the search is always performed, even on builds which returned a non-zero exit status, but the reclassification only applies to builds which returned an overall exit status of zero.


The basic pipeline syntax is as follows:

    findText regexp: '<regular expression>', fileSet: '<file set>'

The regular expression uses the syntax supported by the Java Pattern class. The file set specifies the path to the files in which to search, relative to the workspace root. This can use wildcards, like logs/**/*/*.txt. See the Ant FileSet documentation for details.

To also check the console log, use the following syntax:

    findText regexp: '<regular expression>', fileSet: '<file set>', alsoCheckConsoleOutput: true

Note that if you just want to check the console log, you can omit the file set:

    findText regexp: '<regular expression>', alsoCheckConsoleOutput: true

To customize the build result, you can use any combination of succeedIfFound, unstableIfFound, or notBuiltIfFound. For example, to mark the build as unstable if the expression is found:

    findText regexp: '<regular expression>, alsoCheckConsoleOutput: true, unstableIfFound: true


Versions 1.12 and newer

See the GitHub release page.

Version 1.11 (June 1, 2019)
  • Add pipeline support (#12)
  • Add option to set build as not built (#16)

  • Better log output to console (#21)
Version 1.10 (Jan 31, 2014)
  • No longer blocking concurrent builds. (JENKINS-17507)
  • Cleaner config UI using help buttons
  • Japanese translation
Version 1.9 (Feb 13, 2011)
  • Update link in help
Version 1.8 (Feb 6, 2010)
  • Update code for more recent Hudson
Version 1.7 (May 4, 2009)
Version 1.6 (Nov 6, 2008)
  • Modified to work with all job types, including Maven2 jobs.
Version 1.5
  • Added "Unstable if found" configuration option.  Use this option to set build unstable instead of failing the build.  Default is off (previous behavior).


  1. Unknown User (leojhartiv)

    Does this support multi-line regex searches?

    For instance, if the console had:

    [hibernatetool] 1. task: hbm2ddl (Generates database schema)
    log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
    log4j:WARN Please initialize the log4j system properly.
    alter table account_statement_address add constraint FK612CAF92BE9E69AE foreign key (account_id) references account
    alter table account_statement_address add constraint FK612CAF9212A012FF foreign key (party_geographic_address_id) references party_geographic_address
    alter table statement_copy_addr add constraint FKBBB86BABBE9E69AE foreign key (account_id) references account
    alter table statement_copy_addr add constraint FKBBB86BAB12A012FF foreign key (party_geographic_address_id) references party_geographic_address
    [INFO] Executed tasks

    and I provided a regex of:

    log4j:WARN Please initialize the log4j system properly\.\n(.\|\n){1,}\[INFO\] Executed tasks

    to get the output of hbm2dll.

    1. Unknown User (mattje)

      I've taken 8 years to think about this (wink) , but I'm guessing not:

      My case:

      Target Text: 

       ==  Identical                            1845117 
       <>  Different                            1212    
      >>   Only in Source                       52742   
        << Only in Target                       1215    
       >x  Conflict Source Records              0       
       x<  Conflict Target Records              0


       ==  Identical                            [1-9][0-9][0-9][0-9][0-9][0-9][0-9] \n <>  Different                            [1-7]?[0-9]?[0-9]?[0-9]?

      This has no match, but I've tried in Java Regex testers online and 'The Regex Coach', and they all find a match.

      But trying one line definitely works:

       ==  Identical                            [1-9][0-9][0-9][0-9][0-9][0-9][0-9] 



  2. Unknown User (bazthemail@gmail.com)

    Would you please provide an example on how to search multiple strings from the console log? For example, search for three keywords: "^Error:", "FATAL ERROR", and "ERRORE:". I tried and without succeed.

  3. Unknown User (gunner_1980)

    Does this have the ability to search for multiple regular expressions and return different results based off of them?  From the looks of it you can only pass/fail or choose unstable based off of the searched.  For example I would like to be able to fail the build if it finds one regular expression or show a build as unstable if it finds another.  Right now it looks like it is all or nothing but it would be really nice to be able to specify a regex that would trigger a build fail and another regex that would trigger a build unstable.  The fail would of course need to override any unstable regex's that are found.

  4. Unknown User (fndaway)

    I just added the plug to hudson 1.386

    And check the following: "Hudson Text Finder"  "Also search the console output"  and"Unstable if found"

    and I added as regex "BUILD_FAILED"  w/o quotes. My test script it echoes  "BUILD_FAILED"  and I see the message in the console output,

    However the jobs still is failed (red).  I tried adding "BUILD_FAILED"  with quotes and even ".*" w/o quotes and still fails.

    Please help what I'm doing wrong.


    1. Unknown User (fndaway)

      FYI:  It seems that this plug in to work the exit code from the script must be 0.

      My test.sh exited with 10, however I still want to set it as unstable when "BUILD_FAILED" on console.

      Seems to me like even if the exit code is not zero the but the expression is found the plug-in should still work.


  5. Unknown User (maxrossello)

    If a searched file does not exist, then this is always considered a failure: but this should be configurable.

    For example, I wish to detect IF there are files with a specific name that contain the WARNING string, but if there are no such files all should be considered ok.

    I only found the workaround to always generate an empty file during the build.


  6. Unknown User (william_t_r)

    The documentation for this plugin could be improved a lot - in particular, it would be very helpful if it said

    "This plugin can be used to downgrade a successful build to "unstable" or "failure" if a regular expression matches in a set of files.
    For example, it can be used to search for the string "failure" in a set of log files."

    I have raised https://issues.jenkins-ci.org/browse/JENKINS-12512 to propose this more formally.

    1. Unknown User (mduke)

      The current description on this page seems to cover the points you make.

      As designed, though, the capabilities seem to be limited though:

      • The ability to set either unstable or failed, depending upon what strings are found (Geoff's suggestion)
      • The ability to promote a failed build (in the case of extenuating circumstances for things that crash predictably)
      • The ability to downgrade a build to aborted

      I would like to mark builds aborted in certain circumstances -- for instance when the necessary pre-conditions to perform a successful build have not been met.  When we run our script, the only outcomes (without manual intervention) are failed, succeeded, or unstable, but we already have meaningful scenarios for these.  We could just keep waiting, but then that means it would be a while for people to understand what is going on.

  7. Unknown User (mahesh31)

    Is it possbile to specify multiple files in "Files to Search". If so, how is this achieved.

  8. Unknown User (rd31419)

    Jenkins Text Finder functionality is working but it is taking longer to read the console output. 

    I have no idea about the reason behind it. Could you suggest any.

    13:19:58 Checking console output
    14:18:48 Email was triggered for: Always

    Here's the the expression that I am using:

    (?i)unstable*|.*(?i)completed. Result was FAILURE.*|.*(?i)[INFO] BUILD FAILURE*