Recently I stumbled across the Log Stats tab on my decoders Stats page. When I discovered this, I thought "This is great information, but how can I REALLY make efficient use of this as I am working to put the final nails in the coffin of Envision?"
REST API...
With a few email exchanges and such, I found it was possible to extract the information. But to get it into a consumable format the challenge was on.
Here is the final "sanitized" results of my script. A caveat first;
I have listed two options, for SSL and non SSL decoders.
All values inside < > are specific to your environment.
curl -k -u admin:<admin password> "https://<Non SSL decoder1 of choice>:50102/decoder/?msg=logStats&force-content-type=text/plain">Output1.csv
sed -e 's/forwarder= /local/' -e 's/device=//' -e 's/source=//' -e 's/count=//' -e 's/time=//' -e 's/\ \ */\ /g' -e 's/[:space:]+/,/g' -e 's/forwarder=<SA Log Collector hostname>/<SA_Log_Collector_Friendly_name>/' -e 's/forwarder=<Envision LC IP>/Envision-<Insert name>-LC1/' -e 's/forwarder=<Envision LC IP>/Envision-<Insert name>-LC2/' Output1_LogStats.csv > Output1_LogStats_fixed.csv
sed -e 's/\ /\,/g' -e 's/^.//' Output1_LogStats_fixed.csv > Output1_LogStats_Cleaned.csv
curl -u admin:<admin password> "http://<SSL decoder2 of choice>:50102/decoder/?msg=logStats&force-content-type=text/plain" > Output2.csv
sed -e 's/forwarder= /SA/' -e 's/device=//' -e 's/source=//' -e 's/count=//' -e 's/time=//' -e 's/\ \ */\ /g' -e 's/[:space:]+/,/g' -e 's/forwarder=<SA Log Collector hostname>/SA_Log_Collector_Friendly_name/' -e 's/forwarder=<Envision LC IP>/Envision-<Insert name>-LC1/' -e 's/forwarder=<Envision LC IP>/Envision-<Insert name>-LC2/' Output2_LogStats.csv > Output2_LogStats_fixed.csv
sed -e 's/\ /\,/g' -e 's/^.//' Output2_LogStats_fixed.csv > Output2_LogStats_Cleaned.csv
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.