Search and replace in a logging field?

Scott Baker bakers at canbytel.com
Wed Feb 15 00:08:17 UTC 2012


On 02/14/2012 03:42 PM, Jerimiah Cole wrote:
> On 02/14/2012 11:40 AM, Scott Baker wrote:
>> > Is there a way I can search and replace (remove) some text in the
>> > remote-id before I log it? Specifically I just want to remove the word
>> > "DSL" that's present in all the remote-ids to be consistent with the
>> > rest of my network.
> I don't thik so, but if it's always in the same place in the string, you
> can use substring() to select the pieces before and after the 'DSL'.
> I've attached my log statement and its output as an example.
> 
>> > I've opened a bug with the equipment vendor to remove it before it sends
>> > it to the DHCP server, but I'm not sure how much traction I'll get.
> Assuming you're using Occam/Calix B6, I tried years ago (before the
> buyout) and didn't get far.  I've got lots of active FTTx as well, and
> it prefixes 'Ethernet' on those so I've got another log statement to
> re-format those.

My remote IDs look like "N84-1-1-DSL3" or "N84-1-12-DSL14", which is a
different number of digits, so that would cause problems. Calix/Occam
accepted a feature request to only report the number instead of the port
type + number. We'll see if they actually implement it.

-- 
Scott Baker - Canby Telcom
System Administrator - RHCE - 503.266.8253



More information about the dhcp-users mailing list