Unity 4.2.0 snapshot replication status: problem with filter
Hello,
I can see the Replicated status of a snapshot on a consistency group by outputting all the information but I cannot get it to work using the -filter option. Please see the examples below.
Would someone please indicate the correct column name to pass to the filter option to recover the value of the Replicated column because I need to determine if it 'yes' rather than 'pending'.
I can get by without using a filter option but it is not as tidy a solution.
Thanks,
Rob Gordon
> uemcli -noHeader -d 10.193.5.66 /prot/snap -name MTcg3_1.uniidrtst_TST1 show -detail
Windows world is not too bad. I am sure something may be possible even with a batch scripts (for loop) but powershell is very easy. Below is a simple example from powershell on a windows 7 :
Note: the delimiter of just comma is not enough as some entries can have a comma already, so my earlier bash example will be inaccurate. I used “,” as a split delimiter here to have correct info.
maniemc
169 Posts
660
0
Posted August 16th, 2017 14:00
you have a syntax error with the fields. Field names should be comma separated, case sensitive, double quote is must if it has spaces.
"Name,Replicated" should be "Name","Replicated"
Edit : I see the issue. You are right. The Replicated filter is not working. I will raise a ticket internally for this.
I think we could use some workarounds for now like grep:
04:35:35 service@spa:~> uemcli -noHeader /prot/snap show -detail | egrep "Name|Replicated"
Name = UTC_2017-08-16_05:34:02
Replicated = no
Or if csv is required, awk will be handy:
04:38:41 service@spa:~> uemcli -noHeader /prot/snap show -detail | egrep -n "Name|Replicated"
2 Name = UTC_2017-08-16_05:34:02
25 Replicated = no
04:39:26 service@spa:~> uemcli -noHeader /prot/snap show -detail -output csv | awk -F, '{OFS=",";print $2,$25}'
"Name","Replicated "
"UTC_2017-08-16_05:34:02","no"