Bird
Raised Fist0

Which of the following is the correct JSON structure to define a role with read access to the index logs-2024?

easy📝 Syntax Q12 of Q15
Elasticsearch - Security
Which of the following is the correct JSON structure to define a role with read access to the index logs-2024?
A{"cluster": ["all"], "indices": [{"names": ["logs-2024"], "privileges": ["monitor"]}]}
B{"cluster": ["all"], "indices": [{"names": ["logs-2024"], "privileges": ["write"]}]}
C{"cluster": ["read"], "indices": [{"names": ["logs-2024"], "privileges": ["write"]}]}
D{"cluster": ["monitor"], "indices": [{"names": ["logs-2024"], "privileges": ["read"]}]}
Step-by-Step Solution
Solution:
  1. Step 1: Check cluster privileges for read access

    Read access to an index usually requires cluster privileges like 'monitor', not 'all' or 'read'.
  2. Step 2: Verify index privileges

    The index privileges must include 'read' for the specified index.
  3. Final Answer:

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

    Cluster 'monitor' + index 'read' = correct role [OK]
Quick Trick: Cluster 'monitor' + index 'read' grants read access [OK]
Common Mistakes:
MISTAKES
  • Using 'all' cluster privilege unnecessarily
  • Confusing 'write' with 'read' privileges
  • Assigning 'read' cluster privilege which is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes