Leif Hedstrom created TS-2208:
---------------------------------

             Summary: 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


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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to