import React from 'react'; const CHEAT_SHEET_ITEMS = [ { title: 'See your logs', label: 'Start by selecting a log stream from the Log Labels selector.', }, { title: 'Logs From a Job', expression: '{job="default/prometheus"}', label: 'Returns all log lines emitted by instances of this job.', }, { title: 'Combine Stream Selectors', expression: '{app="cassandra",namespace="prod"}', label: 'Returns all log lines from streams that have both labels.', }, { title: 'Search For Text', expression: '{app="cassandra"} (duration|latency)\\s*(=|is|of)\\s*[\\d\\.]+', label: 'The right search field takes a regular expression to search for.', }, ]; export default (props: any) => (

Loki Cheat Sheet

{CHEAT_SHEET_ITEMS.map(item => (
{item.title}
{item.expression && (
props.onClickExample({ refId: '1', expr: item.expression })} > {item.expression}
)}
{item.label}
))}
);