easyMultiple ChoiceObjective-mapped
CAS-004 Practice Question: An analyst needs to automate the extraction of…
An analyst needs to automate the extraction of indicators of compromise (IOCs) from log files generated by various systems. Which scripting language is most commonly used for cross-platform log parsing and automation due to its extensive library support?
⚠ Common exam trap
Test-takers frequently choose PowerShell (Option A) because they associate it with Windows log parsing (e.g., Event Logs), forgetting the question explicitly requires cross-platform support and extensive library availability for diverse log formats.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Python
Python is the correct answer because it is a cross-platform scripting language with extensive standard libraries (e.g., `re` for regex, `json`, `csv`, `logging`) and third-party packages (e.g., `pandas`, `yara-python`, `stix2`) that simplify parsing diverse log formats and automating IOC extraction. Its portability across Windows, Linux, and macOS makes it ideal for environments with heterogeneous systems, unlike platform-specific alternatives.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
PowerShell
Why it's wrong here
PowerShell is native to Windows and less portable across platforms.
- ✗
Bash
Why it's wrong here
Bash lacks the native library ecosystem for structured data parsing, such as JSON, XML, or CSV, which log files from diverse systems often require; Python’s `pandas` and `json` modules directly address this need. Bash is tempting because it excels at chaining system commands for text manipulation on Unix-like platforms, making it a natural choice for ad‑hoc log grepping in a single‑OS environment, but it fails the cross‑platform automation requirement without extensive external tooling.
- ✗
JavaScript
Why it's wrong here
JavaScript is primarily used for web development, not system log parsing.
- ✓
Python
Why this is correct
Python is cross-platform with extensive libraries for data parsing and automation.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CAS-005 question from scratch — 968 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.