Search and replace in a logging field?

Jerimiah Cole jcole at tbtc.net
Tue Feb 14 23:42:51 UTC 2012


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.

Jerimiah
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: occam_dhcp_log.txt
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20120214/7a5b55c6/attachment.txt>


More information about the dhcp-users mailing list