Forum Discussion

AngryCat_52750's avatar
AngryCat_52750
Icon for Nimbostratus rankNimbostratus
Dec 12, 2013

findstr help

I am trying to phrase txt xml for a username and password.. i am getting the username fine but the password is tripping me up..

the txt looks like this -

    <CustID>CaptAmerica</CustId>
</CustId>
<CustPswd>
    <EncryptionTypeCd>NONE</EncryptionTypeCd>
    <Password>test123</Password>
</CustPassword>

the iRule looks like this -

when HTTP_REQUEST_DATA {
        set username [findstr [HTTP::payload] "CustId>" 15 "&"]
        set password [findstr [HTTP::payload] ";Password>" 6 "&"]
        log local0. "Username - $username , Pwd - $password"
}

the log msg comes out like this - Username - Username - CaptAmerica, Pwd - gt;test123

Any ideas??

  • Not sure what your skip count numbers are supposed to indicate, but try this:

    set username [findstr [HTTP::payload] "CustID>" 10 "&"]
    set password [findstr [HTTP::payload] ";Password>" 13 "&"]