Discussion:
[linux-lvm] Error on RegEx with lv_tags-fields
Oliver Rath
2018-07-09 12:32:10 UTC
Permalink
Hi list,

Im trying to sort some output with lvs using a regex "=~", which results
in an error:

# lvs -o lv_name,lv_tags -S 'lv_tags=~mac1'
  dm_report: incompatible comparison type for selection field lv_tags

Otherwise, using the =~ operator on lv_names works well:

# lvs -o lv_name -S 'lv_name=~z'
  LV 
  z1 
  z2 
  z3 

If I see right, I can use the selection type "string list" here, but no
regex. Is this right? Is there a way to use regex on tags? Im looking
for a way doing

"show me all lv's with tags beginning with "abc.."

TfH!

Oliver
Damon Wang
2018-07-10 07:55:00 UTC
Permalink
I have meet same problem, now I use grep :-D

Damon
Post by Oliver Rath
Hi list,
Im trying to sort some output with lvs using a regex "=~", which results
# lvs -o lv_name,lv_tags -S 'lv_tags=~mac1'
dm_report: incompatible comparison type for selection field lv_tags
# lvs -o lv_name -S 'lv_name=~z'
LV
z1
z2
z3
If I see right, I can use the selection type "string list" here, but no
regex. Is this right? Is there a way to use regex on tags? Im looking
for a way doing
"show me all lv's with tags beginning with "abc.."
TfH!
Oliver
_______________________________________________
linux-lvm mailing list
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Oliver Rath
2018-07-09 09:11:21 UTC
Permalink
Hi list,

Im trying to sort some output with lvs using a regex "=~", which results
in an error:

# lvs -o lv_name,lv_tags -S 'lv_tags=~mac1'
  dm_report: incompatible comparison type for selection field lv_tags

Otherwise, using the =~ operator on lv_names works well:

# lvs -o lv_name -S 'lv_name=~z'
  LV 
  z1 
  z2 
  z3 

If I see right, I can use the selection type "string list" here, but no
regex. Is this right? Is there a way to use regex on tags?

TfH!

Oliver
Peter Rajnoha
2018-07-10 08:50:29 UTC
Permalink
Post by Oliver Rath
Hi list,
Im trying to sort some output with lvs using a regex "=~", which results
# lvs -o lv_name,lv_tags -S 'lv_tags=~mac1'
  dm_report: incompatible comparison type for selection field lv_tags
# lvs -o lv_name -S 'lv_name=~z'
  LV 
  z1 
  z2 
  z3 
If I see right, I can use the selection type "string list" here, but no
regex. Is this right? Is there a way to use regex on tags?
This is not supported yet... but I think we should be able to extend the
functionality here. You can file an upstream report for that if you want
(https://bugzilla.redhat.com/enter_bug.cgi?product=LVM%20and%20device-mapper)
and if there's time/resources, we may add that functionality.
Post by Oliver Rath
TfH!
Oliver
_______________________________________________
linux-lvm mailing list
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
--
Peter
Loading...