Command Line Workstation's get historical data command does not return data as expected

Document ID : KB000100986
Last Modified Date : 13/06/2018
Show Technical Document Details
Issue:
I am trying to retrieve historical data using the get historical data command with following syntax, but it only returned the headers with no data:

java -Xms512m -Xmx512m -Duser= -Dpassword= -jar CLWorkstation.jar get historical data from agents matching .*STAR123.* and metrics matching .* for past 30 minutes | awk '{FS=",";} {print $2,$3,$4,$8,$9,$5;}'

Host Process AgentName Period Intended End Timestamp Resource
Environment:
CA Application Performance Management 10.5.2 HF75
RHEL 7.3
Cause:
If your command doesn't return any error, and you could see the headers being returned, it is most likely due to the agent or metric matching regex expression not matching the actual data, due to incorrect/incompatible syntax. Please also take note that the CLW command is case sensitive.
Resolution:
In this case, the problem lies in the metric matching regex .*

In Linux, we need to use parenthesis, when .* is used on its own without any string appended to it.
Hence, instead of .*, we need to use \(.*\)
 
For example:

java -Xms512m -Xmx512m -Duser= -Dpassword= -jar CLWorkstation.jar get historical data from agents matching .*STAR123.* and metrics matching \(.*\) for past 30 minutes | awk '{FS=",";} {print $2,$3,$4,$8,$9,$5;}'

Note:
The original syntax will work on Windows OS