Elasticsearch - ELK Stack IntegrationWhich of the following is the correct syntax to query Elasticsearch for CPU usage metrics in the last 5 minutes?APOST /metrics/_search { "filter": { "time": "last 5 minutes" } }BGET /metrics/_search { "query": { "range": { "@timestamp": { "gte": "now-5m" } } } }CGET /metrics/_search { "query": { "match_all": {} } }DGET /metrics/_search { "query": { "term": { "cpu": "usage" } } }Check Answer
Step-by-Step SolutionSolution:Step 1: Understand Elasticsearch query syntax for time rangeThe range query with @timestamp and gte (greater than or equal) is used to filter documents by time.Step 2: Identify the correct JSON structureGET /metrics/_search { "query": { "range": { "@timestamp": { "gte": "now-5m" } } } } uses the correct GET method and range query for last 5 minutes.Final Answer:GET /metrics/_search { "query": { "range": { "@timestamp": { "gte": "now-5m" } } } } -> Option BQuick Check:Time range query = GET /metrics/_search { "query": { "range": { "@timestamp": { "gte": "now-5m" } } } } [OK]Quick Trick: Use range query with @timestamp for time filtering [OK]Common Mistakes:MISTAKESUsing POST instead of GET for searchIncorrect JSON structure for time filterUsing match_all without time filter
Master "ELK Stack Integration" in Elasticsearch9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Elasticsearch Quizzes Advanced Patterns - Search after for efficient pagination - Quiz 3easy Advanced Patterns - Async search for expensive queries - Quiz 13medium Advanced Patterns - Point-in-time API - Quiz 7medium Advanced Patterns - Point-in-time API - Quiz 4medium ELK Stack Integration - Alerting and notifications - Quiz 3easy Performance and Scaling - Replica management - Quiz 10hard Security - Field and document level security - Quiz 13medium Security - Audit logging - Quiz 14medium Security - Why security protects sensitive data - Quiz 15hard Security - API key management - Quiz 12easy