txn_box plugin error in example
Does this txn_box example work?
txn_box:
- when: upstream-rsp
do:
- with: [ upstream-rsp-status , proxy-req-path ]
select:
- as-tuple:
- eq: 404
- match: "example" do:
- debug: "Resetting upstream response"
- upstream-rsp-status: [ 200 , "OK" ]
- upstream-rsp-field<Cache-Control>: "max-age=3600"
- as-tuple:
- with: [ upstream-rsp-status , proxy-req-path ]
select:
Error: While parsing as-tuple comparison at Line 5. While loading "with" directive at Line 3 in "select" at Line 5. While parsing directive at Line 3. While loading directives at Line 3.
When i also use
- with: upstream-rsp-status
select:
- eq: 200
It gives error.
@cmcfarlen @brbzull0 can you look into this?. Im using trafficserver 10.2.0
I'm not really familiar with txn_box syntax, but think in header_rewrite that would be like
cond %{READ_RESPONSE_HDR_HOOK} [AND]
cond %{STATUS} =404
set-header @newstatus "Resetting upstream response"
set-status 200
@mlibbey Thanks for your response. I'm looking to build more complex examples, so was testing provided examples since my logic kept running into error. I dont know if etags can be compared during header_rewrite