Hi, I read about threads related to this need and know that there is currently not a way to directly plug in the value in the KQL using urlparam; however, is there a way to do it indirectly? I am thinking about using variables. It works in markdown using var_set and {var "variableName"} but I don't know the syntax of using {var "variableName"} in the KQL. I tried the following but it doesn't evaluate the '{var name="urlParameter"}' correctly(no result returned). Any tips will be apprepriated. Thanks.
| var_set name="requestMethodParam" value={urlparam param=requestMethod default="xxx"}
| var name="requestMethodParam"
| essql
query={string "SELECT \"@timestamp\"
as dateTime, (perfElapseTime)/1000 as \"Time\"
FROM \"log*\"
WHERE filename = 'performance.log'
ND perfMethodName = '{var name=\"urlParameter\"}'
ORDER BY dateTime asc"
}
Thanks. Unfortunately it didn't work. Here's the final version based on your suggestion on the expression.
filters
| var_set name="requestMethodParam" value={urlparam param=requestMethod default="xxx"}
| var name="requestMethodParam"
| essql
query={string "SELECT \"@timestamp\"
as dateTime, (perfElapseTime)/1000 as \"Time\"
FROM \"log*\"
WHERE filename = 'performance.log'
AND perfMethodName = '\"{var name=\"requestMethodParam\"}\"'
ORDER BY dateTime asc"
At this point you will have to debug the SQL query using your own data. I recommend either looking at the Network tab to capture the actual SQL query that you're running, or you could remove the essql command and just run the string "SELECT ..." to get the query. That could help you debug.
Thanks @wylie@Felix_Roessel . I finally got what Felix was saying. Here's the final version that works and be able to use the ulr param value.
filters
| var_set name="requestMethodParam" value={urlparam param="requestMethod" default="xxx"}
| essql {string "SELECT \"@timestamp\"
as dateTime, (perfElapseTime)/1000 as \"Time\"
FROM \"log*\"
WHERE filename = 'performance.log'
AND branch = 'chq' AND perfMethodName = '" {var "requestMethodParam"} "' ORDER BY dateTime asc"
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.