A lookup table contains employee names and IDs. An admin wants to add the employee name to events that contain an employee ID field called 'emp_id'. What is the correct lookup command syntax?
Trap 1: | lookup employee_lookup employee_name FROM emp_id
This syntax is incorrect because FROM is not a valid clause in the lookup command. The correct format is `| lookup lookup-table field-to-match OUTPUT fields-to-add`.
Trap 2: | lookup employee_lookup emp_id OUTPUTNEW *
This command would add all fields from the lookup table as new fields. While it would add the employee name, it also adds any other fields, which may not be desired. The question specifically asks to add only the employee name, so this is not the most precise answer.
Trap 3: | lookup employee_lookup emp_id OUTPUT employee_name
This uses OUTPUT instead of OUTPUTNEW. OUTPUT will overwrite any existing field named employee_name in the event, whereas OUTPUTNEW adds the field only if it does not already exist. Since the requirement is to add the name without overwriting, OUTPUTNEW is the correct choice.
- A
| lookup employee_lookup employee_name FROM emp_id
Why wrong: This syntax is incorrect because FROM is not a valid clause in the lookup command. The correct format is `| lookup lookup-table field-to-match OUTPUT fields-to-add`.
- B
| lookup employee_lookup emp_id OUTPUTNEW *
Why wrong: This command would add all fields from the lookup table as new fields. While it would add the employee name, it also adds any other fields, which may not be desired. The question specifically asks to add only the employee name, so this is not the most precise answer.
- C
| lookup employee_lookup emp_id OUTPUT employee_name
Why wrong: This uses OUTPUT instead of OUTPUTNEW. OUTPUT will overwrite any existing field named employee_name in the event, whereas OUTPUTNEW adds the field only if it does not already exist. Since the requirement is to add the name without overwriting, OUTPUTNEW is the correct choice.
- D
| lookup employee_lookup emp_id OUTPUTNEW employee_name
This is correct because it adds the employee_name field as a new field, ensuring no existing data is overwritten.