Highlighted
tryptyk Trusted Contributor.
Trusted Contributor.
420 views

CEF ASM Mapping in another field

Jump to solution

Dear community,

For CEF F5 ASM logs, I am trying to extract the values of parameters in the HTTP header stored in deviceCustomString3 field to the flexString1 field :

Host: (blabla.com) and True-Client-IP:  (blabla.com)

So I read about a function available in mapping and tried this :

event.deviceProduct,set.expr(deviceCustomString3).event.flexString1,set.event.flexString1Label
ASM,"__regexToken(deviceCustomString3,""(.*)"")","host_header"

Which return me only the first line of the DCS3 ie « GET /assets/img/icon-add.svg HTTP/1.1 »

"\r\n" prevent to catch everything in DSC3, so I erased them:

ASM,"__replaceAll(deviceCustomString3,""\r\n"","""")","host_header"

And it works, I have DSC3 on a single line, then I tried to extract my Host parameter :

ASM,"__regexToken("__replaceAll(deviceCustomString3,""\r\n"","""")","".*Host\\:\\s(.*)Accept.*"")","host_header"

Unfornately catching nothing at all.

Is my syntax the issue ? Is there a limitation of using 2 functions in map ?

Thank you for your feedback. Cheers.

Tags (3)
0 Likes
1 Solution

Accepted Solutions
tryptyk Trusted Contributor.
Trusted Contributor.

Re: CEF ASM Mapping in another field

Jump to solution

EDIT: It works with the right regex "[\\s\\S]" for matching all the line breaks

event.deviceProduct,set.expr(deviceCustomString3).event.flexString1,set.event.flexString1Label
ASM,"__multilineRegexToken(deviceCustomString3,""[\s\S]+Host\:\s(.+)[\s\S]+"")","host_header"

 Thank you very much @mr_ergene !

0 Likes
2 Replies
Knowledge Partner
Knowledge Partner

Re: CEF ASM Mapping in another field

Jump to solution

 

Instead of using __regexToken, use __multilineRegexToken.

------------------------------------
Please use the Like button below, if you find this post useful or mark it as an accepted solution if it resolves your issue.
tryptyk Trusted Contributor.
Trusted Contributor.

Re: CEF ASM Mapping in another field

Jump to solution

EDIT: It works with the right regex "[\\s\\S]" for matching all the line breaks

event.deviceProduct,set.expr(deviceCustomString3).event.flexString1,set.event.flexString1Label
ASM,"__multilineRegexToken(deviceCustomString3,""[\s\S]+Host\:\s(.+)[\s\S]+"")","host_header"

 Thank you very much @mr_ergene !

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.