We are trying to use APM Infrastructure agent Log Monitor extension to gather detailed information from the smtrace log.
The Infrastructure agent Log Monitor has a valueGroup parameter to scrape a number from a file and report it as a metric.
Sample Data:
[02/25/2022][13:02:32.636][13:02:32][11425][139876473235200][CServer.cpp:6863][CServer::Tunnel][][][][][][][][][][][][][279][][][][][][][][Leave function CServer::Tunnel][00:00:00.139874199935]
[02/25/2022][13:02:32.636][13:02:32][11425][139876473235200][CServer.cpp:6372][CServer::ProcessRequest][][][][][][][][][][][][][279][][][][][][][][Leave function CServer::ProcessRequest][00:00:00.139874199935]
[02/25/2022][13:02:32.714][13:02:32][11425][139876481627904][SmAuthUser.cpp:1529][CSmAuthUser::CSmAuthUser][][][][][][][][][][][][][][][][][][][][][Leave function CSmAuthUser::CSmAuthUser][00:00:00.139874199928]
[02/25/2022][13:02:32.714][13:02:32][11425][139876481627904][Sm_Az_Message.cpp:398][CSm_Az_Message::AnalyzeAzMessage][][][][][][][][][][][][][true][][][][][][][][Leave function CSm_Az_Message::AnalyzeAzMessage][00:00:00.000026]
[02/25/2022][13:02:32.714][13:02:32][11425][139876481627904][SmAuthorization.cpp:644][CSmAz::IsProtected][][][][][][][][][][][][][NULL][][][][][][][][Leave function CSmAz::IsProtected][00:00:00.000124]
From this data we want to grab the response time in the last field. => [00:00:00.139874199935]
and report the last portion of this, 00.139874199935, as microsec. => 00139874
Since LongAverage is an integer it won't take floating point input. Also, it seems like log monitor extension can not read the value as time value.
Release : 21.3
Component : APM Power Packs
We have build a fix to provide a solution for this issue.
We have uploaded the changed logmonitor.jar along with the script parameter. The below line has to be added to the logmonitor config file to work along with uploaded jar.
<Scripts name="h2ms" function="function compute(input){var output = ''; vals = input.split(':'); secs=vals[2].split('.');output = (vals[0]) * 60 *1000 * 60 + (vals[1]) * 60 *1000 + (secs[0])*1000+secs[1]; return output;}"/>
Please use this new jar file: logmonitor.jar
Make a back copy of existing one at:
Example: apmia/extensions/log-monitor-92da5316xt35-2022.1.0.25/lib
Then put the new logmonitor.jar that we have provided.
Also attaching a copy of logmonitor-config.xml from test environment that can be used as configuration reference.