Select Sensor Alert Events

LinuxBeginner
Practice Now

Introduction

A sensor export mixes normal, warning, and alert records. An operator needs a smaller file containing every alert and nothing else.

The preceding guided lab practiced filtering delimited records with grep and saving the result. This challenge has that single outcome.

Create the Alert-Only File

Current Situation

/home/labex/project/sensor-pipeline/sensor-events.csv contains six comma-separated records. The third field is the event level.

Scope

  • Select records whose third field is ALERT.
  • Preserve each selected line exactly as it appears in the source.
  • Save the result as alert-events.csv in the same workspace.

Your Goal

Create one file containing all and only the alert records.

Acceptance Criteria

  • alert-events.csv contains exactly the three source lines with ,ALERT,.
  • The lines remain in source order and are otherwise unchanged.

Hints

What fixed text distinguishes the required records?

The guided lab filtered comma-separated records by searching for the delimiter, level, and delimiter together.

Summary

You used a familiar text filter and redirection to produce one complete alert-only data file.

✨ Check Solution and Practice