Forum Discussion

Dran's avatar
Dran
Icon for Nimbostratus rankNimbostratus
May 13, 2020

Stream profile to replace a whole sentence with space on html

Hi

 

I am trying to replace a sentence which has space in between , how do I do it with stream? I just want to replace that sentence alone and not where ever the words in the sentence appear. Currently only single words are getting replaced with the format mentioned in the profile documentations.

1 Reply

  • Hello,

    Could you write some example that you are expecting to reach?

    e.g.

    In case I need to search for "word and space" and replace with "onlyword" string, I do this way:

    when HTTP_REQUEST {
        HTTP::header remove "Accept-Encoding"
        STREAM::disable
    }
    when HTTP_RESPONSE {
        if { [HTTP::header value Content-Type] contains "text" } {
            STREAM::expression {@word\sand\sspace@onlyword@}
            STREAM::enable
        }
    }

    Regards.