Bird
0
0

How do you correctly assign an alias named archive_logs to the index logs_2023 using the Elasticsearch REST API?

easy📝 Syntax Q3 of 15
Elasticsearch - Index Management

How do you correctly assign an alias named archive_logs to the index logs_2023 using the Elasticsearch REST API?

A{ "actions": [ { "add": { "alias": "logs_2023", "index": "archive_logs" } } ] }
B{ "actions": [ { "add": { "index": "logs_2023", "alias": "archive_logs" } } ] }
C{ "actions": [ { "create": { "index": "logs_2023", "alias": "archive_logs" } } ] }
D{ "actions": [ { "add_alias": { "index": "logs_2023", "alias": "archive_logs" } } ] }
Step-by-Step Solution
Solution:
  1. Step 1: Understand the alias action syntax

    The correct action to add an alias is "add" with keys "index" and "alias".
  2. Step 2: Verify the keys and values

    { "actions": [ { "add": { "index": "logs_2023", "alias": "archive_logs" } } ] } correctly uses "index": "logs_2023" and "alias": "archive_logs" inside an "add" action.
  3. Final Answer:

    { "actions": [ { "add": { "index": "logs_2023", "alias": "archive_logs" } } ] } -> Option B
  4. Quick Check:

    Check for correct keys and action name [OK]
Quick Trick: Use 'add' with 'index' and 'alias' keys [OK]
Common Mistakes:
MISTAKES
  • Swapping 'index' and 'alias' keys
  • Using 'create' instead of 'add'
  • Using incorrect action names like 'add_alias'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes