Grouping Expression Question

Business categorization for your virtual environment

Grouping Expression Question

Veeam Logoby caryabend » Thu Feb 07, 2013 8:34 pm

I'm trying to categorize my servers by name, but our naming convention changed.

Our convention follows the general rules of WWWW-XYYY-ZZZ where the string of W's is usually 2 or 4 characters, X may or may not exist, the string of Z's will always be three characters, and the string of Y's may be any length, with dashes to separate the sections.

Just to start, I wanted to group on the substring between the two dashes, and I could figure out how to remove the leading X later.

I discovered that the Grouping Expression Substring(Name,IndexOf(Name,"-") [Note: No closing paren!] evaluated as valid, and returned a number, where I was expecting a string.

My grasp of regular expressions is weak, but this looks there are both parsing and context problems. First, the expression isn't valid, but even adding a length and closing paren doesn't change the output. Second, while I saw that I can't nest CASEs, there's no indication I can't nest operators or methods. The documentation on p255. provides a few examples, but no clear usage or explanation of syntax.

Ideas?

Thanks

Cary
caryabend
Novice
 
Posts: 3
Liked: never
Joined: Wed Jan 30, 2013 5:17 pm
Full Name: Cary Abend

Re: Grouping Expression Question

Veeam Logoby Vitaly.Mzokov » Thu Feb 07, 2013 11:27 pm 2 people like this post

Hi Cary,

Hope my example will give you a hint on how to get all done the right way...

I've got several VMs in my lab which have names like "vm-one-65", "at-one-65", "shared-one-65", etc.
So my need is to separate "SHARED" servers from a rest of my lab VMs. I am simply using something like this construction:
Code: Select all
CASE
WHEN IndexOf(Name, "shared") = 0 THEN "Shared servers for all techs"
WHEN IndexOf(Name, "one") >= 0 THEN "Veeam ONE servers"
ELSE "Not even a Veeam ONE machine"
END

The idea is to see if a substring exists in a full VM's name or not. If it does then "IndexOf" function returns something which is greater than 0.
NOTE: "IndexOf" function returns 0 if a substring is actually a beginnings of a string.

Using the construction mentioned above I get:
1) All VMs which names are started with substring "shared" go to "Shared servers for all techs" group.
2) All other VMs which names have substring "one" in any given position go to "Veeam ONE servers" group.
3) Everything which is not related to Veeam ONE goes to "Not even a Veeam ONE machine" group :)

Hope it gave you some insight on how you can get what you need, Cary. Nevertheless, should any further help be required, please contact our support team via Customer Portal so our techs can assist you on creating a complex Grouping Expression.

- VM.

p.s. Btw, your document improvement request has been noticed ;)
Vitaly.Mzokov
Expert
 
Posts: 173
Liked: 25 times
Joined: Mon Aug 23, 2010 8:30 am
Full Name: Vitaliy Mzokov

Re: Grouping Expression Question

Veeam Logoby caryabend » Fri Feb 08, 2013 3:56 pm

Vitaliy -

Thanks for the quick response. I very well may have to contact the support team, but I hope it won't be necessary.
I might be able to use case statements, but I was hoping to avoid that.

Through more testing, I've discovered that the way spaces get parsed isn't clear.
Substring(Index(Name,"-")+1,4) returns different results than Substring(Index(Name, "-")+1, 4).
Clearly, nesting isn't an option for any types of evaluation. This is too bad, it would have really reduced the logic needed in certain circumstances.

Consider an environment where servers are named:

OWNER-FUNCTION, but neither field has a defined structure. An admin would need to craft a unique case statement for each owner and/or each function, which could be cumbersome in a large enterprise, whereas nesting operators reduces this to one or two statements.

I can handle that the editor doesn't use a true RegEx evaluation, but I'd like to see that documented better.
The spacing issue needs a check, that could be a bear to troubleshoot.

Cary
caryabend
Novice
 
Posts: 3
Liked: never
Joined: Wed Jan 30, 2013 5:17 pm
Full Name: Cary Abend

Re: Grouping Expression Question

Veeam Logoby Vitaly.Mzokov » Mon Feb 11, 2013 2:43 pm

Thanks for your reply Cary,

You're right regarding "spacing" issue - it was confirmed and now went to improvements list for our future versions.
As for original request, unfortunately, using math statements within currently available operators is not possible yet.
But this is a very good feature request, and it's been already forwarded to Product Management team :)

- VM.
Vitaly.Mzokov
Expert
 
Posts: 173
Liked: 25 times
Joined: Mon Aug 23, 2010 8:30 am
Full Name: Vitaliy Mzokov


Return to Business View



Who is online

Users browsing this forum: No registered users and 2 guests