Bird
Raised Fist0

Which syntax correctly defines field-level security in an Elasticsearch role?

easy📝 Syntax Q3 of Q15
Elasticsearch - Security
Which syntax correctly defines field-level security in an Elasticsearch role?
A"fields": ["title", "author"]
B"fields": "title, author"
C"fields": {"include": "title"}
D"fields": {"exclude": ["title"]}
Step-by-Step Solution
Solution:
  1. Step 1: Review correct field-level security syntax

    Field-level security uses a list of fields under "fields" key to allow access.
  2. Step 2: Check options for correct format

    "fields": ["title", "author"] uses a list of field names correctly; others use wrong types or keys.
  3. Final Answer:

    "fields": ["title", "author"] -> Option A
  4. Quick Check:

    Field list syntax = array of strings [OK]
Quick Trick: Field list must be an array of strings [OK]
Common Mistakes:
MISTAKES
  • Using string instead of array
  • Using object instead of array
  • Confusing include/exclude keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes