Python is the winner?-)
Please see some info here. I will translate this post into English, i hope.
around the essentials…
Please see some info here. I will translate this post into English, i hope.
I just have wrote about Extract part of FreeRadius” log with a little awk script. Then I decided that it whould be easier and quicker than with Python.
Here is a Python script, which does the same (and written in the same way):
Today I needed to extract some records from FreeRadius” log — those with Called-
or Calling-Station-Id
like XXXYYZ[0-2]. Started to type #!/usr/bin/python
in new file, but «suddenly» decided to do it with awk.
If you don’t know — FreeRadius’s log contains «sections» separated by empty lines. Every section contains records Called-Staion-Id = <number>
(or Calling-Station-Id
), and i need to extract sections regarding calls to/from specific numbers.
So, the five-minutes-working-code: