Skip to main content
Solved

How do I write a database query for a DB Collector that uses state-tracking for MS SQL?

  • March 11, 2025
  • 0 replies
  • 21 views

How do I write a database query for a DB Collector that uses state-tracking for MS SQL?

Best answer by Tony R

Looking at https://docs.cribl.io/stream/collectors-database#tracking-column, the example is:

SELECT * FROM my_table WHERE ${state && state.id ? id > ${state.id.value} : '1 = 1'} ORDER BY id

  • Employee
  • Answer
  • March 11, 2025

Looking at https://docs.cribl.io/stream/collectors-database#tracking-column, the example is:

SELECT * FROM my_table WHERE ${state && state.id ? id > ${state.id.value} : '1 = 1'} ORDER BY id