Apache Trafficserver

Wednesday Sep 04, 2013

Custom logs and identifying remap rules

In a recent project we worked on, we needed to add a custom log which also had to identify which exactly remap rule triggered. I think this is probably a worthwhile feature to add to ATS (see https://issues.apache.org/jira/browse/TS-2181), but there's an easy way using existing plugins to accomplish this. Using (for example) the header_filter.so standard plugin, you can setup a config for each remap rule that you wish to identify.

    map http://www.example.com http://x.example.com @plugin=header_filter.so @pparam=id_a.config 

Where id_a.config contains simply

    [READ_REQUEST_HDR]
        @MapID =a_mapping= 

 In a custom log, you can then log this as

    %<{@MapID}cqh> 

Voila! The trick here is that headers with the @ prefix are considered internal to ATS, and are removed before sending to servers or User-Agents.

Comments:

I am new to servers and linux and learning a lot from you.. but i have a query... if any one can help please.. In apache access logs if i have to count number of access attempts made to my server within a timestamp say from 12:15:00 to 12:50:00 on a perticular day ,,then how will i do so??? 

Posted by gaurav on April 19, 2014 at 08:20 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Search

Hot Blogs (today's hits)

Tag Cloud

Categories

Feeds

Links

Navigation