search cancel

Alarm search API query fails when there is colon or semicolon in alarmid

book

Article ID: 228076

calendar_today

Updated On:

Products

DX Operational Intelligence

Issue/Introduction

DX SAAS tenant:

When using apmgw endpoint and query alarm (alarm which has colon/semicolon in alarmid), We getting failure.

curl  -s 'Connection: keep-alive'  -H 'accept: application/json'   -H 'authorization:  Bearer eyJ0a24iOiIwODk5XXXXXXXXXXXXXXXXXXXXXXXXXXXXyNzQtOTRiMy01ZWJkMmQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOnRydWV9'  -H 'content-type: application/json' 'https://apmgw.dxi-na1.saas.broadcom.com:443/oipublic/aoanalytics/alarms/alarms_all/_search?q=alarm_unique_id%3AINFRASTRUCTURE%5C%3AHOST%5C%3Aserver-1.bjdfkasnfest-2.aws.scdsnc.net%5C%3AfAOHJDSJ-BQ-gO-o345mW9%5C%3A2021-10-08T00%5C%3A01%5C%3A19' | jq .
{
  "took": 23,
  "timed_out": false,
  "_shards": {
    "total": 35,
    "successful": 35,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 0,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  }
}

Environment

Release : 20.2

Component : CA DOI ALARM ANALYTICS

Resolution

Example Alarm ID from the OI UI:

INFRASTRUCTURE:HOST:server-1.sfhdf.az-b.us-west-2.aws.fhsdf.net:fAHJSDFOJ-BQ-gO-o345mW9:2021-10-08T00:01:19+0000 

Test the query with following command:

curl  -s 'Connection: keep-alive'  -H 'accept: application/json'   -H 'authorization:  Bearer eyJ0a24iOiIwOXXXXXXXXXXXXXXXXXXXXTRiMy01ZWJkMmQ4ZjcwXXXXXXXXXXXXXXXXXXXnRydWV9' -H 'content-type: application/json' 'https://apmgw.dxi-na1.saas.broadcom.com:443/oipublic/aoanalytics/alarms/alarms_all/_search?q=alarm_unique_id:%22INFRASTRUCTURE:HOST:server-1.sfhdf.az-b.us-west-2.aws.fhsdf.net:fAHJSDFOJ-BQ-gO-o345mW9:2021-10-08T00:01:19%2B0000%22'