You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:42:27 UTC

[GitHub] [brooklyn-server] jcabrerizo opened a new pull request #1241: Fix logbook query by EntityId or TaskId

jcabrerizo opened a new pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241


   It try to find the Ids in the fields and the message for both, `FileLogStore` and `OpenSearchLogStore`,  instead of only search for it on the message as before.
   
   Requires changes in the UI for sending the Ids as independent fields in the query parameters 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] algairim commented on a change in pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
algairim commented on a change in pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241#discussion_r699394604



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/opensearch/OpenSearchLogStore.java
##########
@@ -253,17 +250,47 @@ protected String getJSONQuery(LogBookQueryParams params) {
             queryBoolMustListBuilder.add(ImmutableMap.of("range", ImmutableMap.of("timestamp", timestampMapBuilder.build())));
         }
 
+        // Apply search taskId.
+        if (Strings.isNonBlank(params.getTaskId())) {
+            queryBoolMustListBuilder.add(
+                    ImmutableMap.of("bool",
+                            ImmutableMap.of("should",

Review comment:
       `should` is an OR match condition, meaning to look for taskId in the `taskId` filed or `message` field, right? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] jcabrerizo commented on a change in pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
jcabrerizo commented on a change in pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241#discussion_r699399884



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/opensearch/OpenSearchLogStore.java
##########
@@ -253,17 +250,47 @@ protected String getJSONQuery(LogBookQueryParams params) {
             queryBoolMustListBuilder.add(ImmutableMap.of("range", ImmutableMap.of("timestamp", timestampMapBuilder.build())));
         }
 
+        // Apply search taskId.
+        if (Strings.isNonBlank(params.getTaskId())) {
+            queryBoolMustListBuilder.add(
+                    ImmutableMap.of("bool",
+                            ImmutableMap.of("should",

Review comment:
       Short answer: yes, it how it work when it's inside a "bool" sentence. The docs are here https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-bool-query.html but I needed to see some examples to have the query working 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] jcabrerizo merged pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
jcabrerizo merged pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] algairim commented on a change in pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
algairim commented on a change in pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241#discussion_r699394604



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/opensearch/OpenSearchLogStore.java
##########
@@ -253,17 +250,47 @@ protected String getJSONQuery(LogBookQueryParams params) {
             queryBoolMustListBuilder.add(ImmutableMap.of("range", ImmutableMap.of("timestamp", timestampMapBuilder.build())));
         }
 
+        // Apply search taskId.
+        if (Strings.isNonBlank(params.getTaskId())) {
+            queryBoolMustListBuilder.add(
+                    ImmutableMap.of("bool",
+                            ImmutableMap.of("should",

Review comment:
       `should` is an OR match condition, meaning to look for taskId in the `taskId` filed or `message` field, right? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] jcabrerizo merged pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
jcabrerizo merged pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] jcabrerizo commented on a change in pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
jcabrerizo commented on a change in pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241#discussion_r699399884



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/opensearch/OpenSearchLogStore.java
##########
@@ -253,17 +250,47 @@ protected String getJSONQuery(LogBookQueryParams params) {
             queryBoolMustListBuilder.add(ImmutableMap.of("range", ImmutableMap.of("timestamp", timestampMapBuilder.build())));
         }
 
+        // Apply search taskId.
+        if (Strings.isNonBlank(params.getTaskId())) {
+            queryBoolMustListBuilder.add(
+                    ImmutableMap.of("bool",
+                            ImmutableMap.of("should",

Review comment:
       Short answer: yes, it how it work when it's inside a "bool" sentence. The docs are here https://www.elastic.co/guide/en/elasticsearch/reference/6.8/query-dsl-bool-query.html but I needed to see some examples to have the query working 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [brooklyn-server] algairim commented on a change in pull request #1241: Fix logbook query by EntityId or TaskId

Posted by GitBox <gi...@apache.org>.
algairim commented on a change in pull request #1241:
URL: https://github.com/apache/brooklyn-server/pull/1241#discussion_r699394604



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/opensearch/OpenSearchLogStore.java
##########
@@ -253,17 +250,47 @@ protected String getJSONQuery(LogBookQueryParams params) {
             queryBoolMustListBuilder.add(ImmutableMap.of("range", ImmutableMap.of("timestamp", timestampMapBuilder.build())));
         }
 
+        // Apply search taskId.
+        if (Strings.isNonBlank(params.getTaskId())) {
+            queryBoolMustListBuilder.add(
+                    ImmutableMap.of("bool",
+                            ImmutableMap.of("should",

Review comment:
       `should` is an OR match condition, meaning to look for taskId in the `taskId` filed or `message` field, right? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org