You can search logs by sending single or multiple queries.
Request URL
https://<Your BMC Helix Portal URL>/logs-service/api/v1.0/logs/msearch
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/msearch
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>
Request body
{
valid JSON queries in the ndjson format
}
Example - request body
{"size":10,"query":{"bool":{"filter":[{"range":{"@timestamp":{"gte":"2021-07-26T08:00:22Z","lte":"2021-07-26T08:41:22Z"}}}]}}}
{"size":10,"query":{"bool":{"filter":[{"match":{"message":"NullPointerException"}},{"range":{"@timestamp":{"gte":"2021-07-26T08:00:22Z","lte":"2021-07-26T08:41:22Z"}}}]}}}
{"size":10,"query":{"match":{"status":"500"}}}
Successful response
Search result is returned.
Unsuccessful responses
Scenario 1: Unable to log on to BMC Helix Log Analytics
Contact BMC Support.
Scenario 2: Incorrect request body
Ensure that the query is correct.
Troubleshooting
Issue: Long response time
Reason: The payload response size is more than 20 MB.
Workaround: Optimize the query or reduce the time period of query.
Response codes
| | |
---|
| Details of query results returned, like total, skipped, failed, and successful records. | Search result is returned. |
| | Verify request header, JSON format of the query, and request body. |
| Authentication has failed | |
| Unable to connect to server. | No records are received. Contact BMC Support. |