Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 915835

Summary: CLI: "pattern" and "replacement" should be required when creating logging filter
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: LoggingAssignee: James Perkins <jperkins>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: brian.stansberry, chaowan, pkremens, smcgowan
Target Milestone: ER4   
Target Release: EAP 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kremensky 2013-02-26 15:31:31 UTC
I am able to set filter attribute without "pattern" and "replacement" although they are not nillable.

calling:
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=filter, value={replace => {"replace-all" => true}})

will create useless filter:
"filter" => {"replace" => {
    "replace-all" => true,
    "pattern" => "undefined",
    "replacement" => "undefined"
}}
"filter-spec" => "substituteAll(\"undefined\",\"undefined\")"

only "replace-all" is actually required now:
[standalone@localhost:9999 /] /subsystem=logging/console-handler=CONSOLE:update-properties(filter={replace => {"pattern" => "JBAS","replacement" => "SABJ"}})
{
    "outcome" => "failed",
    "failure-description" => "JBAS014749: Operation handler failed: null",
    "rolled-back" => true
}

Comment 1 James Perkins 2013-03-08 00:30:08 UTC
Need an upstream JIRA.

Comment 2 JBoss JIRA Server 2013-03-12 09:55:39 UTC
Chao Wang <chaowan> made a comment on jira AS7-6713

patch to check "pattern" and "replacement" values can't be undefined from LoggingWriteAttributeHandler.validateUpdatedModel()

Comment 3 JBoss JIRA Server 2013-03-14 00:11:23 UTC
James Perkins <jperkins> made a comment on jira AS7-6713

Writing a fix for this and testing various other filters I think I opened Pandora's box :-). I'll suggest for a workaround use the {{filter-spec}} expressions instead. I'll also note, I should probably document those.

Comment 4 JBoss JIRA Server 2013-03-14 01:46:46 UTC
Chao Wang <chaowan> made a comment on jira AS7-6713

wrt filter-spec expression, I tried to configure something similar, but unsuccessfully as described in https://community.jboss.org/thread/222386

Comment 6 Petr Kremensky 2013-04-12 11:16:37 UTC
Behaviour described in description is fixed. There is new info message that filter attribute is deprecated and thus should not be used. Closing Pandora's box :). 

Verified with EAP 6.1 ER4