-
1. Re: Query Language - Special Characters
Andrew WatersFeb 9, 2018 10:42 AM (in response to Nicole Maalouf)
1 of 1 people found this helpfulI assume you mean from the UI? there is nothing special with "-". Are you sure that you did not end up with a different character than you think. Unicode helpfully has lots of hyphen characters.
-
2. Re: Query Language - Special Characters
Nicole Maalouf Feb 9, 2018 10:53 AM (in response to Andrew Waters)Yes, querying from the generic query function in the UI.
I copied directly from the "Name" attribute on the BAI in the UI and pasted in to the query, I assume this would give me the same hyphen.
I also tried to rewrite the code setting the attribute to use "(" in place of "-", and could not query by that character either. I can query any text before or after, but not the entire "Query Language - Special Characters"
-
3. Re: Query Language - Special Characters
Andrew WatersFeb 9, 2018 11:03 AM (in response to Nicole Maalouf)
1 of 1 people found this helpfulI trust you spelt BusinessApplicationInstance correctly in the query.
If you look in tw_svc_model.log does it show the correct query?
-
4. Re: Query Language - Special Characters
Bob AndersonFeb 9, 2018 12:40 PM (in response to Nicole Maalouf)
2 of 2 people found this helpfulCheck your quoting characters
I copied from your post, and the 2 searches that look for equality 2 single quotes before and after the string.
The search using 'matches' shows 1 double quote before and after the string.The courier font facse shows that very clearly:
search BusinessApplicationInstance where name = ''Query Language - Special Characters''
search BusinessApplicationInstance where name matches "Query Language -"
search BusinessApplicationInstance where name = ''Query Language -''
I tried to do a similar search, just using the hyphen characters, but in SoftwareInstance, like this:
search SoftwareInstance where name matches '-'
yields results in 11.1, and 11.2 but
search SoftwareInstance where name matches ''-''
yields no results in 11.1
and Expression Not Supported in 11.2+
Your first query may work if you just used 1 single quote for the string
Your second query should work, unless there are other white space characters in the name that we cannot see.
Your third query should return nothing, even when fixing the quotes for the string.
You could also try some more regex specific pattern matching like
search BusinessApplicationInstance where name matches regex '^(?i)Query\s+Language\s+-'
HTH
Bob -
5. Re: Query Language - Special Characters
Nicole Maalouf Feb 9, 2018 1:24 PM (in response to Bob Anderson)I had no luck with either of these either, single quotes or regex..
search BusinessApplicationInstance where name matches '- Special Characters'
returns results
however, the entire string still returns nothing 'Query Language - Special Characters'
-
6. Re: Query Language - Special Characters
Andrew WatersFeb 12, 2018 1:34 AM (in response to Nicole Maalouf)
1 of 1 people found this helpfulYou cannot be matching the actual value. If the first case works then that would imply you need to be looking at the beginning of the value.
-
7. Re: Query Language - Special Characters
Bob AndersonFeb 12, 2018 7:22 AM (in response to Nicole Maalouf)
2 of 2 people found this helpfulAs Andrew said, if the first case is not working, then there are some other 'white space' characters (more spaces, tabs, new-line, carriage-return, etc) in the actual BAI name.
Try searching for the word 'Query' in the BusinessApplicationInstance name, as this removes any attempt to also find 'white space' characters.
search BusinessApplicationInstance where name matches regex '(?i)query' show fmt('-->%s<--', name) as 'Formatted Name'
This debugging query just adds some 'pinchers' around the name attribute which helps to un-hide some leading or trailing white-space characters.
If this brings back expected one of your sought-after BAIs, the problem is more than likely in one of 2 places: Either the 'copy and paste' of the BusinessApplicationInstance name included some 'white-space' characters that were not matched in the first search queries, or the code where the BusinessApplicationInstance 'name' attribute is generated is including some white-space characters that are not being matched in the first search queries.
Just curious, how were the BAIs created? With SAAM, CAM, or your own custom patterns?
-
8. Re: Query Language - Special Characters
Nicole Maalouf Feb 14, 2018 1:39 PM (in response to Bob Anderson)I still do not seem to be able to query correctly using these suggestions. The BAI was created with a custom pattern where I define it as -->
bai_name := "%app_name% - %lifecycle%";
This value appears correctly on the BAI name in the ADDM UI, but copying exactly from there does not allow me to find it in a query.
-
9. Re: Query Language - Special Characters
Nicole Maalouf Feb 14, 2018 1:42 PM (in response to Bob Anderson)I see no white space before or after while using the debugging query you offered
-
10. Re: Query Language - Special Characters
Nicole Maalouf Feb 14, 2018 1:51 PM (in response to Bob Anderson)These return correctly:
search BusinessApplicationInstance where name matches regex '(?i)- Special Characters' show fmt('-->%s<--', name) as 'Formatted Name'
search BusinessApplicationInstance where name matches regex '(?i) - Special Characters' show fmt('-->%s<--', name) as 'Formatted Name'
As soon as I add text before the "-", returns nothing:
search BusinessApplicationInstance where name matches regex '(?i)y - Special Characters' show fmt('-->%s<--', name) as 'Formatted Name'
From the beginning, these return correctly:
search BusinessApplicationInstance where name matches regex '(?i)Query' show fmt('-->%s<--', name) as 'Formatted Name'
search BusinessApplicationInstance where name matches regex '(?i)Query ' show fmt('-->%s<--', name) as 'Formatted Name'
As soon as I add "-" after the space, returns nothing:
search BusinessApplicationInstance where name matches regex '(?i)Query -' show fmt('-->%s<--', name) as 'Formatted Name'
Leads me to believe there has to be an issue with interpreting the dash "-"
-
11. Re: Query Language - Special Characters
Andrew WatersFeb 14, 2018 2:10 PM (in response to Nicole Maalouf)
1 of 1 people found this helpfulThere is no interpretation of a dash.
Have you tried exporting to a CSV file so you can exactly see the name.
-
12. Re: Query Language - Special Characters
Nicole Maalouf Feb 14, 2018 3:11 PM (in response to Andrew Waters)great suggestion! seems there is a line return between "y" and the space before the -
this does not necessarily appear in the CSV, but if I copy from the csv to notepad it pastes as:
Query
- Special Characters'
So, can I query to ignore line returns?
-
13. Re: Query Language - Special Characters
Nicole Maalouf Feb 14, 2018 3:14 PM (in response to Nicole Maalouf)or - any idea how this was set in this way?
Earlier, I tried to set it in my TPL pattern using "Query(Special Characters)" instead, this pastes the same way with a line break
-
14. Re: Query Language - Special Characters
Shane Smith Feb 14, 2018 3:55 PM (in response to Nicole Maalouf)1 of 1 people found this helpfulSounds like the %app_name% variable has a \n or \r on the end of it which would be an artifact of how you are getting that value. It may help to do a
log.debug("App Name: %bai_name%");
This could account for it if you know there are one or more (space, tab, new line, return, )
search BusinessApplicationInstance where name matches regex '(?i)y\s+- Special Characters' show fmt('-->%s<--', name) as 'Formatted Name'