Bird
Raised Fist0

Which JSON snippet correctly defines a role granting read privileges on the logs-2024 index in Elasticsearch?

easy📝 Syntax Q3 of Q15
Elasticsearch - Security
Which JSON snippet correctly defines a role granting read privileges on the logs-2024 index in Elasticsearch?
A{ "indices": { "names": "logs-2024", "privileges": "read" } }
B{ "indices": [{ "names": ["logs-2024"], "privileges": ["read"] }] }
C{ "indices": [{ "names": "logs-2024", "privileges": "write" }] }
D{ "indices": [{ "names": ["logs-2024"], "privileges": ["write"] }] }
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON Structure

    Indices must be an array of objects with 'names' as an array and 'privileges' as an array.
  2. Step 2: Verify Privileges

    The role requires 'read' privileges, not 'write'.
  3. Final Answer:

    { "indices": [{ "names": ["logs-2024"], "privileges": ["read"] }] } -> Option B
  4. Quick Check:

    Correct array usage for names and privileges [OK]
Quick Trick: Use arrays for 'names' and 'privileges' [OK]
Common Mistakes:
MISTAKES
  • Using string instead of array for 'names' or 'privileges'
  • Assigning wrong privilege type
  • Incorrect JSON object structure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes