Hi Willy,

On Thu, Mar 30, Willy Tarreau wrote:
> On Thu, Mar 30, 2017 at 07:18:48AM +0300, Jarno Huuskonen wrote:
> > Hi,
> > 
> > On Sat, Mar 25, Aleksandar Lazic wrote:
> > > how about to try this, it's untested.
> > > 
> > > http-request set-var(req.mysticky)
> > > url_param(email),url_param(newsletter_id)
> > > stick on req.mysticky table detailspage
> > 
> > I didn't get this to work.
> > 
> > I didnt find a way to concat the two url_params. These are some examples
> > I tried:
> > http-request set-var(req.mysticky) %[urlp(em)]%[urlp(nl)]
> > http-request set-var(req.mysticky) %[urlp(em)],%[urlp(nl)]
> > http-request set-var(req.mysticky) urlp(em),urlp(nl)
> > http-request set-var(req.mysticky) urlp(em)urlp(nl)
> > 
> > Using header seems to work:
> > http-request set-header X-Concat %[urlp(em)]%[urlp(nl)]                     
> > http-request set-var(req.mysticky) req.hdr(X-Concat)
> > 
> > Is there a way to concat strings in set-var w/out using header ?
> 
> Not for now. With Thierry we've started to think about a stack-based
> expression evaluator which would make it trivial to concat strings
> and perform many other operations but we found that it will suffer
> from some deep problems like retrying failed fetches.

Do you have any examples what kind operations could be possible with
the evaluator ?

> Thus I think that for now we'll have to only implement a "concat"
> converter supporting a constant string and another one to concat a
> variable. Maybe we can call them "strcat()" for constant strings
> and "varcat()" for variable names. Is anyone interested in working
> on this ?

I'm not volunteering (at least not yet:) but before strcat/varcat is
available maybe we could add couple of examples to configuration.txt
how you can do some concat functionality with headers ?

Do you see any use for simple substring replace (w/out regexps) ?

-Jarno

-- 
Jarno Huuskonen

Reply via email to