Bird
0
0

You execute hdfs dfs -cat /logs/app.log | grep ERROR but no errors appear, despite knowing errors exist. What might cause this?

medium📝 Debug Q6 of 15
Hadoop - Cluster Administration
You execute hdfs dfs -cat /logs/app.log | grep ERROR but no errors appear, despite knowing errors exist. What might cause this?
AThe grep command is case-insensitive by default
BThe log file path is incorrect or the file is empty
CHDFS is down and cannot read files
DThe errors are logged in a different file format
Step-by-Step Solution
Solution:
  1. Step 1: Verify file existence and content

    If the file path is wrong or the file is empty, grep returns no output.
  2. Step 2: Consider grep behavior

    grep is case-sensitive by default, but if errors exist, they should appear unless file is empty or path wrong.
  3. Final Answer:

    The log file path is incorrect or the file is empty -> Option B
  4. Quick Check:

    Check file path and content first [OK]
Quick Trick: Check file path and content before grep [OK]
Common Mistakes:
  • Assuming grep ignores case by default
  • Ignoring possibility of empty or missing files
  • Blaming HDFS without verification

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Hadoop Quizzes