name: extract
about: Extract structured data or matching lines from text and logs
clipboard: false
args:
- name: file
short: 'f'
expect: string
help: Path to the log or text file
- name: query
short: 'q'
expect: string
help: Extraction criteria (e.g., 'find all errors')
actions:
- tag: tag_lines
run: cmd
expect: list<string>
action: cat {file}
- tag: tag_content
run: llm_small
expect: string
action: |
[Task]
Read the log line and the search query.
If the line matches the query — output the EXACT line unchanged.
If the line does not match — output only a single dash: "-"
Do NOT skip lines. Process every line.
[Query]
{query}
[Line]
{tag_lines}
- tag: tag_clean
run: value
expect: string
action: '{tag_content|trim:-}'
- tag: tag_extract
run: value
expect: string
action: '{tag_clean|join:uniq}'