← Node guide
Utility

Find in Text

Searches text an earlier step produced and hands back the matching lines plus a found / not-found answer.

util.find
The piece

Search a log capture, shell output or any text from an earlier step. Returns the matching lines and a found / not-found answer to branch on — the usual way to turn a logcat into a verdict.

Reach for it when

  • Turning a log capture into a verdict — did it crash, or did it not?
  • Pulling an id or a value out of a log line without a second step.
Find in Text
Idle
In the bag

Every setting this block has. A field marked only when appears once you have chosen the mode above it — those are alternatives to each other, not extra things to fill in.

  • Search inRequired
    starts at —

    Drop a field from the data panel — {{ $Read Logs.json.log }}, {{ $Read Logs.json.lines }} or {{ $Shell Command.json.stdout }}. A list is searched line by line.

  • Look forRequired
    starts at —

    Plain text, or a regular expression when the mode below says so — e.g. FATAL EXCEPTION, ANR in.

  • Match by
    starts at Contains this text

    A regular expression also captures: anything in ( ) from the first hit comes back as groups, so you can pull an id out of a log line without a second step.

    Contains this textRegular expression
  • Match upper/lower case
    starts at off
  • Keep at most
    starts at 50

    How many matching lines to carry forward. The count is the real total either way — 3 of 900 crashes is a different bug from 3 crashes.

Build it
  1. Point at the text

    Drop a field from the data panel — a log capture, its lines, or a shell command's output. A list is searched line by line.

    Find in TextSettings
    Search inRequired
    {{ $Read Logs.json.log }}
    Look forRequired
    FATAL EXCEPTION
    Match by
    Contains this text
  2. Get the lines back, and the count

    Keep at most caps how many lines are carried forward, but the count is always the real total — three of nine hundred crashes is a different bug from three crashes.

    $Read Logs.json.log
    • I/Activity onResume
    • E/AndroidRuntime FATAL EXCEPTION
    • I/Network 200 /v1/cart
    • E/AndroidRuntime FATAL EXCEPTION
    • I/Activity onPause
    matches · found = true
    • FATAL EXCEPTION
    • FATAL EXCEPTION
    • count: 2
  3. Branch on the answer

    A regular expression also captures: anything in parentheses from the first hit comes back as groups, so an id can be pulled out of a log line here rather than in a step of its own.

    Find in Text
    If / Branch
    Fail the Run
What comes out
  • Whether anything matched, the matching lines, the real total, and any regex capture groups.
Watch out
  • Case matching is off by default. For a log tag that is usually what you want and occasionally not.
  • Finding nothing is a perfectly good answer, not a failed step. It is the If / Branch after it that decides what it means.
Usually next to