Now that we are sending logs from CloudWatch to OpenSearch lets create an index patterns and run a simple search to validate that our logs are actually being sent to OpenSearch.
OpenSearch is capable of more than search it can also build visualizations and more. In this section we will perform a simple search to ensure that our logs are actually being delivered.
Check out the Visualize and Analyze section of the OpenSearch Log Analytics workshop for a more thorough lab on searching and visualizing logs.
You should now see a window that looks like this
The Lambda functions the send the messages from CloudWatch to OpenSearch will create a new OpenSearch index each day. Each index name will start with cwl and will be followed by the date.
To search all of the CloudWatch logs (ie. multiple days) we will create an index pattern in OpenSearch. The index pattern will be a representation of all of the cwl log indexes for all of the days.
cwl-*
under the index pattern name section@timestamp
as the primary time fieldWe have now created an index pattern! We can use the index pattern to analyze our logs
OpenSearch provides the ability to easily search log data. Lets run a simple search on our logs to validate that they have been successfully sent from CloudWatch to OpenSearch.
The Glue Jobs that you ran earlier logged custom message of Success!! and Error!!
We can search for the Success!! logs
This will bring you to the discovery page. On this page we can see the log data sent from CloudWatch
Success!!
you will see the log message that the Glue job created during its executionYou will see a few logs that contain the customer log message from the Glue Job. Feel free to spend a few minutes trying other OpenSearch searches. See if you can search for the other Error!! logs
When you are ready proceed to the next step Clean Up if you want to delete the resources we used for this workshop