Bug 535440 (RHQ-2135)

Summary: Add substring function to groupby clause on group definition
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: Resource GroupingAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: hbrock, jshaughn
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-2135
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-05 21:03:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Charles Crouch 2009-06-08 21:18:00 UTC
What I'd like to be able to do is specify the following

groupby resource.name.substring(0,3)
resource.type.plugin = JBossAS
resource.type.name = JBossAS Server

which would return me a set of groups where each group contains JBAS instances whose names started with the same three characters. 
This would be useful in environments where strong naming conventions are used and people want to group together resources which have similar, but not identical names.

Could potentially use a regex method instead that relied on matching capturing groups, e.g. a potentially more flexible version of first example

groupby resource.name.regex("^(.{3})") 
resource.type.plugin = JBossAS
resource.type.name = JBossAS Server


 ^(.{3}) is meant to capture the first 3 characters of the name (pseudo-regex :-)) , this could be evaluated for every resource then those resources with the same capture would be put in the same group.

Comment 1 Red Hat Bugzilla 2009-11-10 20:58:31 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2135