Forum Discussion
igshapir
Microsoft
Dec 09, 2018Verbatim string with single slash in query (@'\')
Hi All,
I am trying to work with a verbatim string which contains a single slash - @'\'
It seems that Log Analytics has a bug validating it.
I am using the following query:
print ...
Dec 10, 2018
Hi,
From your question it is not clear what you are trying to achieve but may be this is workaround for you?
print '\\'
This will produce single slash.
- igshapirDec 10, 2018
Microsoft
My scenario is quite simple. I have several queries that filter some logs which contain filenames.
A common action is to split the filename by a slash.
I can use '\\' and that what we currently do. The annoying part is that those queries are stored inside a json file which requires additional escaping.
So we want to split by a single slash and have to write 4 slashes. This works, but a bit confusing. So I am trying to reduce the number of escapes required. And I thought to use verbatim string.