Description of problem: I am really not sure how to create logging filters using filter-spec. I am able to use only: accept, deny, not and match expressions. I tried to use deprecated filter attribute for help: [standalone@localhost:9999 console-handler=CONSOLE] :write-attribute(name=filter, value={replace => {"pattern" => "JBAS","replacement" => "DUMMY","replace-all" => true}}) will create: [standalone@localhost:9999 console-handler=CONSOLE] :read-resource ... "filter-spec" => "substituteAll(\"JBAS\",\"DUMMY\")", ... but: [standalone@localhost:9999 console-handler=CONSOLE] :write-attribute(name=filter-spec, value=substituteAll("JBAS","DUMMY")) { "outcome" => "failed", "failure-description" => "JBAS014688: Wrong type for filter-spec. Expected [EXPRESSION, STRING] but was LIST", "rolled-back" => true } Did I overlook something? If yes, can you please create some simple example commands, so we can add this feature to EAP documentation. I use community documentation here https://docs.jboss.org/author/display/AS72/Logging+Configuration#LoggingConfiguration-FilterExpressions Version-Release number of selected component (if applicable): EAP 6.1.1 ER2
It's more likely an issue with the way CLI parses the value. Your value argument is correct. I'm not sure if it's possible to use in CLI which is a problem. I can't figure out the syntax at least. It tried escaping with " with \", but that didn't work.
https://github.com/jbossas/jboss-eap/pull/270
I am quite confused by this fix. You've just added test for filter (which is deprecated, filter-spec should be used instead). Filter expressions are still not working. You can try examples from documentation - (13.1.5. Filter Expressions for Logging) - http://documentation-devel.engineering.redhat.com/docs/en-US/Red_Hat_JBoss_Enterprise_Application_Platform/6.1/html/Administration_and_Configuration_Guide/chap-The_Logging_Subsystem.html#Filter_Expressions_for_Logging
I thought you had an issue creating the filters through the cli which this test checks. Could you be more precise on what you mean by 'not working' ?
I had an issue with creating filter-spec through the cli. There are two attributes in every logging handler, filter and filter-spec. Filter accepts type OBJECT, but it is deprecated now and filter-spec should be used as alternative. see CLI read-resource output: "filter" => { "type" => OBJECT, "description" => "Defines a simple filter type.", "alternatives" => ["filter-spec"], "deprecated" => { "since" => "1.2.0", "reason" => "Use filter-spec." }, .... Filter-spec accepts Strings and should be able to cover functionality of original filter. My problem is, that I am unable to create more complicated filters with filter-spec eg. :write-attribute(name=filter-spec, value=substituteAll("JBAS","DUMMY")).
The received command has lost the first escaped quote
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=filter-spec, value=substituteAll("JBAS" \, "DUMMY")) is working You have to escape the comma so the value is correctly assumed to be a String otherwise it would be parsed as a List.
Emmanuel Hugonnet <ehugonne> made a comment on jira WFLY-1791 The argument values are parsed a second time which means that the escaped char have been unescaped. Changing this in the PR: https://github.com/wildfly/wildfly/pull/5159
Alexey Loubyansky <alex> made a comment on jira WFLY-1791 This has been merged.
Verified on EAP 6.2.0.CR3. One can use filter expression with escaped comma like: [standalone@localhost:9999 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=filter-spec, value=substituteAll("JBAS"\,"SABJ"))
Mostly people don't know what the author of this article wants to discuss here. But in simple words, I can explain my Filter product https://bestosmosissystems.com/best-water-softener-reviews/ site where I am busy selling my water filters. These filters make your water pure and healthy for drink.