[TNM] Problems with logfile name and POSIX escape syntax

Sari Thiele sari.thiele at usit.uio.no
Tue Apr 22 05:35:53 UTC 2014


No, it does not work with postgresql-%Y-%m-%d_%H%M%S.csv!
It is still not finding the log files.

The reason why I use this logfile name is, because another tool, 
pg_statsinfo, needs exactly this name for the log file.

So the documentation states:

> FILE:
>
>     (mandatory) This is the name of the file(s) to be scanned. More than one FILE can be added. In addition to an absolute file name, the following formats are supported:
>         POSIX escape syntax, for example: FILE: /var/log/pg_log/postgresql-%Y-%m-%d.log
>         The special word LATEST. which will cause the program to use the file in that directory that was most recently changed. For example: FILE: /var/lib/postgresql/8.4/main/pg_log/LATEST

It seems to me that I need to use the POSIX escape syntax.
I think that this is a bug in tailnmail.




On 04/10/2014 09:46 AM, Sari Thiele wrote:
> correction:
>
> It looks like that is does work with postgresql-%Y-%m-%d_%H%M%S.csv, but
> now I get this message:
>
> WARNING! Skipping non-existent file "log/postgresql-2014-04-10_093905.csv"
> Too many loops (10081): bailing
>
> Does there exist a parameter or another solution that can fix it?
>
>
>
> On 04/09/2014 08:06 PM, Sari Thiele wrote:
>> No,  unfortunately that does not work in my setup, because we do a
>> logration once in a month
>> and so the file name stays the same for a month.
>> I tried it with
>>
>> postgresql-%Y-%m-%d_%H%M%S.csv
>>
>> but tail_n_mail does not find it.
>> The program looks for a file with the date/time when it was started, it
>> does not look for a file
>> in the past. That is the reason why I tried it with a regex.
>>
>>
>> On 09.04.2014 17:22, Greg Sabino Mullane wrote:
>>> On Wed, Apr 09, 2014 at 11:21:36AM +0200, Sari Thiele wrote:
>>>> Hi!
>>>>
>>>> I am trying to set up tail_n_mail with a logfile name
>>>> "postgresql-%Y-%m-%d_%H%M%S.csv".
>>>> The documentation states that it is possible to define the name with
>>>> POSIX escape syntax.
>>>> But if I use f.ex. FILE:
>>>> '/<path>/postgresql-[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}_[0-9]\{6\}.csv',
>>>> it does not work.
>>> It should work if you use exactly the same syntax as Postgres. In other
>>> words, use postgresql-%Y-%m-%d_%H%M%S.csv.
>>>
>>
>

-- 
Sari Thiele
UiO/USIT/IT-drift/TD/DBD


More information about the TNM mailing list