I have a logstash config file that I need to convert to a chef erb template (mainly the filters section). However, I keep running into issues due to the format of the grok patterns. Below is an example of the grok pattern.
  grok {
    match => ["message", "<%{POSINT:seqnum1}>%{POSINT:seqnum2}: (\d*: |\.|\*)*%{SYSLOGTIMESTAMP:timestamp} %{WORD:tz}: \%%{WORD:facility_label}-(%{WORD:switch_id}-)*%{INT:severity}-%{WORD:program}: %{GREEDYDATA:message}"]
Here is the issue. Shortly after this I need to have some interpolation fill in an IP address etc. But it wont because the <% starts an interpolation of its own. 
mutate {
  add_field => {"[@metadata][sentry][msg]" => "%{host}"
    "[@metadata][sentry][severity]" => "%{severity}"
    "[@metadata][sentry][host]" => "<%= @sentry_host[:ipaddress] %>"
    "[@metadata][sentry][pid]" => "<%= @sentry_pid %>"
    "[@metadata][sentry][key]" => "<%= @sentry_key %>"
    "[@metadata][sentry][secret]" => "<%= @sentry_secret %>"
  }
}
So all of the values above are processed as the string of <%= @sentry_... %>.
Is there a way to get around this? I have tried the escape method of <%%{POSINT:seqnum1}>%{POSINT:seqnum2}:%> seen here. But it still puts the closing %> in. Any other ways to escape characters/strings in ERB?
Thanks! Josh