3月 122012
 

varnishlogtrans version up(mapping from vcl_trace to vcl source)

Past Articles:convert varnishlog output to easy

Changes

  • Feature: mapping from vcl_trace to vcl source(line).(request from @perbu)
  • Feature: show backend status.(request from @dai_yamashita)
  • Change: Add run option.
  • Experimental: mapping from vcl_trace to vcl source(all).
  • mapping from vcl_trace to vcl source(line).

    if you set to -f option, replace vcl_trace to VCL code
    before.

    
             | trace  | vrt_count:1 vcl_line:55 vcl_pos:1
    
    

    after(use -f and -e option)

    
             | trace  | set req.http.X-TEST1=campur_xcir.gethash();
             |        | ^ (vrt_count:1 vcl_line:55 vcl_pos:1 src_name:input)
    
    
    

    show backend status.

    show backend status.
    past status is window 4times.

    
    backend status
    ------------------------------------------------------------
    
    name    | status  | past status
    default | healthy | YY
    
    

    Add run option.

    -f [vcl file]

    if you set, you can mapping from vcl_trace to vcl source.

    -e [varnishd]

    if you set, you can mapping from vcl_trace to vcl source.

    -cc_command [cc_command]

    if you set in the -f option and varnish’s cc_command option ,please setting.

    –(backend|action|variable) [on|off]

    if you want to disable (backend|action|variable) info , set to off. (default is on)

    mapping from vcl_trace to vcl source(all).

    this function is unstable.
    if you want use this function.
    it need change value and set option(–src=on -f=[vclfile] -e=[varnishd]).

    before

    
    define('experimental' , false);
    
    

    after

    
    define('experimental' , true);
    
    

    output

    
    ############################################################
    vcl trace
    [exec]      /* "input"*/
    [exec]  /*
    
    ...
    
    [exec]  sub vcl_recv {
    [exec]      if (req.restarts == 0) {
    [exec]          if (req.http.x-forwarded-for) {
                        set req.http.X-Forwarded-For =
                            req.http.X-Forwarded-For + ", " + client.ip;
    [exec]          } else {
    [exec]              set req.http.X-Forwarded-For = client.ip;
    [exec]          }
    [exec]      }
    [exec]      if (req.request != "GET" &&
    [exec]        req.request != "HEAD" &&
    [exec]        req.request != "PUT" &&
    [exec]        req.request != "POST" &&
    
    ...
    
    

    I hope that this code is of help to you.

    download here.
    varnishlogTrans


     Leave a Reply

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

    (required)

    (required)

    このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください