@cryptotaxi247 / netdata-1 / commits / b0bcc8fa6

reset the log sources to apply user selection (#18725)

fix logs POST query payload parsing again

Costa Tsaousis committed Oct 8, 2024 at 17:36 UTC b0bcc8fa67a01a3cc97f42f9f0c07a9243b33d72
1 file changed +7 -2
src/libnetdata/facets/logs_query_status.h
+7 -2
@@ -403,9 +403,14 @@ static inline bool lqs_request_parse_json_payload(json_object *jobj, const char
403 return false;
404 }
405
406 - buffer_json_member_add_array(wb, key);
406 + bool is_source = false;
407 + if(strcmp(key, LQS_PARAMETER_SOURCE) == 0) {
408 + // reset the sources, so that only what the user selects will be shown
409 + is_source = true;
410 + rq->source_type = LQS_SOURCE_TYPE_NONE;
411 + }
412
408 - bool is_source = strcmp(key, LQS_PARAMETER_SOURCE) == 0;
413 + buffer_json_member_add_array(wb, key);
414
415 size_t values_len = json_object_array_length(val);
416 for (size_t i = 0; i < values_len; i++) {