You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Susan Hinrichs (JIRA)" <ji...@apache.org> on 2014/11/05 21:49:35 UTC

[jira] [Updated] (TS-2208) LogFilter does not have a way to configure "conjunction"

     [ https://issues.apache.org/jira/browse/TS-2208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Susan Hinrichs updated TS-2208:
-------------------------------
    Fix Version/s:     (was: 5.2.0)
                   6.0.0

> LogFilter does not have a way to configure "conjunction"
> --------------------------------------------------------
>
>                 Key: TS-2208
>                 URL: https://issues.apache.org/jira/browse/TS-2208
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Logging
>            Reporter: Leif Hedstrom
>             Fix For: 6.0.0
>
>
> In the LogFilter implementation details, there's code to deal with "OR" and "AND" such that you can express either
> REJECT if x AND y
> or
> REJECT if x OR y
> However, there's no way to configure this in logs_xml.config, m_does_conjunction is always true afaik (so only the OR case above is supported). So even though the code supports both of the above, there's no way to express it:
> {code}
>   bool m_does_conjunction;
>   // If m_does_conjunction = true
>   // toss_this_entry returns true
>   // if ANY filter tosses entry away.
>   // If m_does_conjunction = false,
>   // toss this entry returns true if
>   // ALL filters toss away entry
> {code}
> This seems properly implemented in the LogFilterList::toss_this_entry() method:
> {code}
> bool LogFilterList::toss_this_entry(LogAccess * lad)
> {
>   if (m_does_conjunction) {
>     // toss if any filter rejects the entry (all filters should accept)
>     //
>     for (LogFilter * f = first(); f; f = next(f)) {
>       if (f->toss_this_entry(lad)) {
>         return true;
>       }
>     }
>     return false;
>   } else {
>     // toss if all filters reject the entry (any filter accepts)
>     //
>     for (LogFilter * f = first(); f; f = next(f)) {
>       if (!f->toss_this_entry(lad)) {
>         return false;
>       }
>     }
>     return true;
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)