Find String in Fields – Utility

I was recently tasked with how to find all occurrence of a specific string that could exist in any field in any form on a Remedy system.  This poses an interesting challenge and my first gut check for this type of request would be to go-to the database so after some searching, I had found the following which gave me most of the information I was looking for:

The above would provide output that would list the T tables and C columns where a match was found which got me part of the way there, would still need to then go search on that form/field to find the entries in question.

So after see this in action, I decided to see what the difference in performance would be to do something similar but using only the Remedy API and came up with the attached program.  It actually ran in about the same amount of time and I can get a bit more detail then the SQL proc gave me.

You can download the program at the bottom of this post and run the program like this:

java -jar FindStringInFields.jar -x <servername> -u <username> -p <password> -t <port> -s <string to search for in doublequotes> -o <name of output file, defaults to output.csv if not set here>

While the program is running, you will be kept up to date on the progress via a progress bar and when completed will tell you how many matches have been found.  After completion, the results will be provided in a CSV style file with formName, fieldName, fieldID and entryID for all found occurrences.

Here is a screenshot of it in action where I search my own local system for server name references:


Hope this is useful.

Leave a Reply

Your email address will not be published. Required fields are marked *