Right now I'm trying to do this with a simple test. I have an NSH script job that I'm running against 2 servers. One will succeed and one will intentionally fail. What I'd like to be able to do is get the logs for the instance that failed from blcli. I was originally going to just parse the information from JobRun getLogItemsByJobRunId, but it doesn't seem like there's a way to tell which logs go with which execution of the script.
So from there I found getServersStatusByJobRun and getLogItemsByDevice, but I can't find any information on defining what the paramaters are that you pass in for getLogItemsByDevice. There is
sortParameter - com.bladelogic.om.infra.model.job.jobrun.LogItemSortParameter
sortOrder - com.bladelogic.om.infra.shared.db.QuerySortOrder
startIndex - Integer
endIndex - Integer
But I can't for the life of me find an example or more information on what format and content you need to pass for the first 2, and there no info on what the indexes are of and what they're used for.
Does anyone have more information on how to use this command or is there a different way I can isolate the logs for just the servers that errored in an NSH script job?
For anyone else who's run into this, I found a solution. You can use the getLogItemsByDevice in the LogItems namespace.