Community discussions

MikroTik App
 
alanpatx
just joined
Topic Author
Posts: 11
Joined: Fri Mar 01, 2013 10:16 am

at-chat logging to file

Thu Aug 16, 2018 3:39 pm

Hi,
I am working on a project to extract LTE signal values from modems and log them to file. The modems I have do not present RSRP or RSRQ values to the Mikrotik interface, so they need to be retrieved using modem AT commands.

I have the following script file working:

Code: Select all

:global "rsrp";

/interface lte at-chat lte2 input="AT+ZSRSP\?" as-value;
:log info $"rsrp";
This creates several lines in my log file with two carriage returns and an "OK" as below:

Code: Select all

output: +ZSRSP:"-096.30","-08.80","-068.00","7"

OK

How can I filter that so that the log file contains only the line with the information, removing the CRs and "OK"?

Thanks,

Alan
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: at-chat logging to file

Thu Jan 23, 2020 10:41 pm

alanpatx
I am working on a project to extract LTE signal values from modems and log them to file.
I hope this "file" is not at RB NAND but on external disk (to prevent Bad Blocks).
Better way is send signals to remote syslog what you can do via logging.
.
The modems I have do not present RSRP or RSRQ values to the Mikrotik interface, so they need to be retrieved using modem AT commands.
/interface lte at-chat lte2 input="AT+ZSRSP\?" as-value;
output: +ZSRSP:"-096.30","-08.80","-068.00","7"
How can I filter that so that the log file contains only the line with the information, removing the CRs and "OK"?
Try this:
[marcin.przysowa@SXTR_LTE6] > put [interface lte at-chat lte1 input="ati" wait=no as-value ]
output=MikroTik
OK
[marcin.przysowa@SXTR_LTE6] > put ([interface lte at-chat lte1 input="ati" wait=no as-value ]->"output")     
MikroTik
Please play with this: https://wiki.mikrotik.com/wiki/Manual:Scripting and: len put pick

Who is online

Users browsing this forum: No registered users and 18 guests