$ dbt show --inline "select 1" --output json --log-format json
Gives you a result like this:
{
"data": {
"is_inline": true,
"node_name": "inline_query",
"output_format": "json",
"preview": "[{\"ID\": 1}]",
"quiet": false,
"unique_id": "sql_operation.jaffle_shop.inline_query"
},
"info": {
"category": "",
"code": "Q041",
"extra": {},
"invocation_id": "cfafbca5-a6e2-4cd1-a61c-68507e8880c4",
"level": "info",
"msg": "{\n \"show\": [\n {\n \"ID\": 1\n }\n ]\n}",
"name": "ShowNode",
"pid": 82436,
"thread": "MainThread",
"ts": "2026-01-13T03:31:55.861546Z"
}
}
Without the --output json flag, you’ll get a preview which is formatted as an ASCII table, much harder to work with programmatically.
Bonus: if you’re using the dbt Fusion engine, swap to --log-format otel for a better-structured record
{
"record_type": "LogRecord",
"trace_id": "019bb5637fc074d08664d779927fe7db",
"span_id": "a0d9f7aa53c546ad",
"span_name": "Node evaluated (model.jaffle_shop.inline)",
"event_id": "019bb563-8958-7231-9db7-726f0bdb5cc1",
"time_unix_nano": "1768274757976894000",
"severity_number": 9,
"severity_text": "INFO",
"body": "",
"event_type": "v1.public.events.fusion.log.ShowDataOutput",
"attributes": {
"columns": [
"ID"
],
"content": "[{\"ID\":1}]",
"dbt_core_event_code": "Q041",
"is_inline": true,
"node_name": "inline_query",
"output_format": "SHOW_DATA_OUTPUT_FORMAT_JSON"
}
}