Hi,
You should be able to achieve this relatively easily using the STREAM::replace command. Have a look at the example below.
when HTTP_REQUEST {
Collects the entire payload as per content lenght
HTTP::collect [HTTP::header Content-Length]
}
when HTTP_REQUEST_DATA
Sets var to string
set string_to_find [findstr [HTTP::payload] TAG 4 <]
log local0. "String $string_to_find identified in Request payload"
Release payload
HTTP::release
}
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
You can use strings or Regexs to match string (this one matches email addresses)
STREAM::expression {@[a-z0-9._%+-]+\@[a-z0-9.-]+\.[a-z]{2,6}@@}
Reenables the stream filter
STREAM::enable
}
when STREAM_MATCHED {
Sets data to replace
set data_to_replace "something"
Replaces string with var
STREAM::replace $data_to_replace
}
Cheers,
Claud