Write basic LogQL queries.
BeginnerConceptLogging: ELK/EFK, Loki & Log Shippers
Answer
{namespace="payments", app="api"} # stream selector
{app="api"} |= "error" != "timeout" # line filters
{app="api"} |~ "status=(500|502|503)" # regex filter
{app="api"} | json | level="error" | duration > 500ms # parse and filter
{app="nginx"} | logfmt | line_format "{{.method}} {{.path}} {{.status}}"
Always start with the most selective stream selector, then line filters, then parsers. Line filters are the cheapest step.
More on Logging: ELK/EFK, Loki & Log Shippers
What is the ELK stack, and what is EFK?BeginnerHow does Elasticsearch store and search logs?IntermediateWhat is ILM (Index Lifecycle Management) and why do log clusters need it?IntermediateWhat is an Elasticsearch data stream?AdvancedWhat is an index template and mapping, and what is a mapping explosion?AdvancedWhat does Logstash do compared with Beats?Intermediate