[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] SuSE : Spaces in a log-prefix?
On 13-Jul-05 lesleyb wrote:
> chris wrote:
>> On Thu, 2005-07-07 at 10:41 +0100, lesleyb wrote:
>>
>>>Hello
>>>
>>>I can't seem to get this minor problem sorted out.
>>>
>>>Using the variable :
>>>
>>>$LOG_PR1="LAB_TEST_IN "
>>>
>>>with a filter rule with this action
>>>
>>>-j LOG --log-prefix $LOG_PR1
>>>
>>>correctly logs the event but the trailing space gets lost in the log
>>>so
>>>that I get
>>>
>>>LAB_TEST_ININ=eth0
>>>
>>>instead of
>>>
>>>LAB_TEST_IN IN=eth0
>>>
>>>Anyone know the right way to get the desired result?
>>>
>>
>>
>> can you escape the space to make it a hard space?
>>
>> eg "LAB_TEST_IN\ "
>>
>> Not sure if this is valid for where you are using it ...
>>
> Yep, I tried escaping it and I got LAB_TEST_IN\IN
> which might be considered an improvement but not quite what I was
> after.
> ;-)
You might try something like
$LOG_PR1="LAB_TEST_IN@"
so that your primary log file would contain the likes of
LAB_TEST_IN [at] IN=eth0
(I'd have suggested "_" rather than "@" as more readable, but
you've pre-empted "_" elsewhere).
Assuming that "@" has not turned up for other reasons, the
primary log file could be easily converted into what you really
want to see by something like
cat logfile | tr '@' ' '
Hoping this helps,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding [at] nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 13-Jul-05 Time: 11:26:48
------------------------------ XFMail ------------------------------
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.