Concept Flow - Logstash overview
Start Logstash
Input: Receive Data
Filter: Process & Transform
Output: Send Data
End
Logstash takes data in, processes it, and sends it out in a flow from input to filter to output.
input { stdin {} } filter { mutate { lowercase => ["message"] } } output { stdout { codec => rubydebug } }
| Step | Action | Input Data | Filter Applied | Output Data |
|---|---|---|---|---|
| 1 | Receive input | HELLO WORLD | None yet | HELLO WORLD |
| 2 | Apply filter | HELLO WORLD | Lowercase message | hello world |
| 3 | Send output | hello world | Filter done | hello world |
| 4 | Wait for next input | None | None | None |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | Final |
|---|---|---|---|---|---|
| message | None | HELLO WORLD | hello world | hello world | hello world |
Logstash processes data in three parts: Input: where data comes in Filter: where data is changed or enriched Output: where data is sent out Data flows step-by-step through these stages Filters modify data before output
input { stdin { } } filter { mutate { add_field => { "new_field" => "value" } } } output { stdout { codec => rubydebug } }input { file { path => "/var/log/syslog" } } filter { grok { match => { "message" => "%{SYSLOGTIMESTAMP:timestamp}" } } } output { elasticsearch { hosts => ["localhost:9200"] } }Pass the test and this pattern moves unknown