concepts / log-json-schema / events / sql-query-event

Log Event JSON Schema - event.sql_query

Note: Our libraries integrate with frameworks and libraries to log this event automatically.

The sql_query event resresents a SQL query being issued from within your application.

Example JSON Structure

This:

SELECT * FROM users (0.5ms)

Gets structured into:

1
2
3
4
5
6
7
8
{
  "event": {
    "sql_query": {
      "sql": "SELECT * FROM users",
      "time_ms": 0.2
    }
  }
}

Field descriptions

NameTypeDescription
sqlstringThe raw SQL of the query. required max-length: 5000
time_msnumberThe time taken to execute the query in milliseconds. required

Using this data

Example queries:

  • Search: sql_query.time_ms:>50
  • Only this event: is:sql_query

See our doc on searching.

Questions?

Chat with us, just click the talk button in the bottom right of this page.

Chat with us
Sign Up

Log better and solve problems faster, today. Install in under a minute.

Sign Up