Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1577954

Summary: virt-who does not take Regular Expressions.
Product: Red Hat Satellite Reporter: Jaskaran Singh Narula <janarula>
Component: DocumentationAssignee: Tahlia Richardson <trichard>
Status: CLOSED CURRENTRELEASE QA Contact: Sergei Petrosian <spetrosi>
Severity: medium Docs Contact:
Priority: high    
Version: 6.5.0CC: ahumbe, chris.snell, jherrman, jhnidek, khowell, ktordeur, mkalyat, rhel-docs, rjerrido, tlestach, trichard, wpoteat, yuefliu
Target Milestone: UnspecifiedKeywords: Documentation, Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-04 09:13:23 UTC 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 Jaskaran Singh Narula 2018-05-14 13:54:31 UTC
Description of problem:

Virt-who does not take regular expression into consideration when it is mentioned in virt-who.conf file as well. 

Steps to Reproduce:
1. Set up hypervisors with hostnames as hostnam0202.example.com and hostname02003.example.com 
2. Add filter host parameter in the virt-who.conf file as filter_hosts=hostname00[\d\d\d].*
3. check if the hosts are visible on satellite web ui. 

Actual results:
No hypervisors are showing up on the satellite web ui or even in one shot of virt-who. 

Expected results:
All the hypervisors and guest VMs should come up on satellite and also in one shot of virt-who. 

Additional info:

Comment 4 Kenny Tordeurs 2018-05-15 09:08:34 UTC
The regex in question is:

filter_hosts=server0[\d\d\d].*

server0 matches the characters server0 literally (case sensitive)
Match a single character present in the list below [\d\d\d]
\d matches a digit (equal to [0-9])
\d matches a digit (equal to [0-9])
\d matches a digit (equal to [0-9])
.* matches any character (except for line terminators)
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed

As `man virt-who-config` states regex is supported changing it from RFE to BUG.

~~~
 filter_hosts
              Only hosts which uuid (or hostname or hwuuid, based on hypervisor_id) is specified in comma-separated list in this option will be reported. Wildcards and regular  expressions  are  supported.
              Put the value into the double-quotes if it contains special characters (like comma). filter_host_uuids is deprecated alias for this option.
~~~

Comment 5 Kevin Howell 2018-05-30 15:28:24 UTC
Dev: let's add a filter_type option, that can be set to either regex or glob. If unset, let's have the current (ambiguous, confusing) behavior (deprecated), with a warning that filter_type should be defined in order to choose one or the other.

So for the customer in comment 4, the solution once implemented will be to set the filter_type to regex to ensure unambiguous parsing.

Comment 6 Kenny Tordeurs 2018-05-31 07:14:50 UTC
@Kevin that sounds good, thanks !

Comment 7 Ashish Humbe 2018-06-14 10:18:04 UTC
After we implement it, the customers who want to use regex or glob in " filter_hosts " parameter they should set "filter_type" accordingly, right?

There are few customers who use Regex in the hypervisor names while filtering so adding this option will help them but can we please make sure it will not break anything for other customers who are using plain hostnames / UUIDs.

Comment 15 William Poteat 2019-07-19 18:09:55 UTC
The cause of this is from the way ini files are handled.
A backslash needs to be escaped i.e.:

filter_hosts=server0[\\d\\d\\d].*


This is not a bug with virt-who.

Comment 16 Chris 2019-07-19 19:08:52 UTC
Please reopen this and retag it as a documentation bug, then, because those details are nowhere to be found in the virt-who filtering documentation (https://access.redhat.com/documentation/en-us/red_hat_satellite/6.5/html/virtual_instances_guide/virt_who_installation_and_configuration_overview#filtering_scope_of_virt_who_access)

Comment 17 Jiri Herrmann 2019-12-02 14:54:54 UTC
*** Bug 1667343 has been marked as a duplicate of this bug. ***