Bird
Raised Fist0

Which of the following is the correct JSON structure to define an input for a watch that searches an index named logs?

easy📝 Syntax Q3 of Q15
Elasticsearch - ELK Stack Integration
Which of the following is the correct JSON structure to define an input for a watch that searches an index named logs?
A{"input": {"query": {"index": "logs"}}}
B{"input": {"index": "logs"}}
C{"search": {"input": {"indices": ["logs"]}}}
D{"input": {"search": {"request": {"indices": ["logs"]}}}}
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct input syntax for search

    The input must have a 'search' key with a 'request' containing 'indices'.
  2. Step 2: Match the correct JSON structure

    {"input": {"search": {"request": {"indices": ["logs"]}}}} correctly nests 'input' → 'search' → 'request' → 'indices'.
  3. Final Answer:

    {"input": {"search": {"request": {"indices": ["logs"]}}}} -> Option D
  4. Quick Check:

    Input search syntax = {"input": {"search": {"request": {"indices": ["logs"]}}}} [OK]
Quick Trick: Input search needs 'search' then 'request' with 'indices' [OK]
Common Mistakes:
MISTAKES
  • Placing 'indices' outside 'request'
  • Using 'index' instead of 'indices'
  • Misplacing 'input' key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes