Refinery Transformation Regex

Regex examples for the Chaos Refinery. As new examples are highlighted we will share them here, but please reach out with any cool transformation's you've done.

Refinery Regex Examples:

AWS ELB Logs - parse Body field

(?:(\\w+:\\w+:\\w+:\\w+-\\w+-\\d+:\\d{12}+)):(\\S+)\\s(?:(\\D\\w+\\D)(\\S+)") (\\S+) (\\S+) (\\S+) (\\S+) (\\S+) (\\S+) (\\S+) (\\S+) (\\S+) (\\S+) (\\S+)

Common field names added, 15 fields in total:

body.arn
targetGroup
body.root
body.traceID
body.domain_name
body.chosen_cert_arn
body.matched_rule_priority
body.request_creation_time
body.actions_executed
body.redirect_url
body.error_reason
body.target_port_list
body.target_status_code_list
body.classification
body.classification_reason

IP Address Breakdown

(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)

IP Address & Port separation

(^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}):(\\d+)

Request Breakdown

(\\w+) (\\S+) (\\w+.\\d.\\d)

AWS ARN KMS Separation

(\\w+):(\\w+):(\\w+):(\\w+-\\w+-\\d+):(\\d{12}+):(\\S+)

URI Stem

(\\S+[ :])(\\d+)(\\S+)

or

https:\\/\\/(\\S+):(\\d+)(\\S+)

or

http:\\/\\/(\\S+):(\\d+)(\\S+)

Updated 3 months ago

Refinery Transformation Regex


Regex examples for the Chaos Refinery. As new examples are highlighted we will share them here, but please reach out with any cool transformation's you've done.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.