I have a customer who logged some cc and bank account numbers in their apache logs. I got the cc numbers x'd out with
sed -e 's/args=[0-9]\{16\}/args=XXXXXXXXXXXXXXXX/g' -e 's/cardnum=[0-9]\{16\}/cardnum=XXXXXXXXXXXXXXXX/g'
but that wasn't too difficult due to the value being 16 digits.
The bank account info is different, might be 6 digits, might be 10, might be 15. The actual string in the log entry will contain
args=123456789&acctnum=123456789
somewhere in the middle of the line.
Now that I think about it, the new value doesn't have to match the original, meaning if it's a 7 digit value, I don't have to have 7 x's, I can replace the value, whatever the length, with say 7 or 10 x's. I'm just not sure how to identify the original variable length string.
Man, thanks for the quick replies everyone. I haven't played with any of them yet, I will after this post. But I wanted to give you the entire picture, just in case it helps, sorry should have put this in the orig post.
Here is a single entry from the log (edited of course)
if the number of X-s doesn't have to match the number of the original digits:
sed 's#args=[0-9][0-9]*&routing=[0-9][0-9]*&args=[0-9][0-9]*&acctnum=[0-9][0-9]*#args=xxxxxxxx\&routing=xxxxxxxx\&args=xxxxxxxx\&acctnum=xxxxxxxx#' myFile
I started testing with the most recent posts and low and behold the last one from vgersh99 worked perfectly.
Many thanks to all of you for your efforts.
Vgersh99 if I could send you the beverage of your choice I would, but in this
medium you'll have to settle for a