Hi,
I'm trying to configure a monitor (tail) and i've set the following query:
select to_char(b.data_reg,'rrrr-mm-dd hh24:mi:ss') DATA_HORA, a.dominio, a.cliente,a.entidade, b.valor NUM_PED_PROGRESS from carateristicas_metricas a, metricas b where b.id>42813607 and a.id_metrica=b.id_metrica and a.metrica='NUM_PED_PROGRESS' order by 1
From the manual,
"Use a specific SQL query to pull the data in: select the Configure
advanced Database lookup settings checkbox, then define a SQL query
and use the $input_field$ as a placeholder for each input field."
I've set the Rising Column as "b.id"
but when I try to run the monitor I'm getting the following error:
dbx3358:ERROR:TailDatabaseMonitor - Configuration Error: Invalid query specified! Missing placeholder for condition!
What argument should I change to obtain the correct result ?
This works {{AND $rising_column$ > ?}} with MSSQL
The ? references the rising_column field you set outside the query in "Tail Input settings".
After the first parse where the entire output of the query is pulled into Splunk.
The tail option kicks in and only pulls in new data based on the rising column.
Have you tried
where a.id_metrica=b.id_metrica and a.metrica='NUM_PED_PROGRESS'
{{AND $rising_column$ > 42813607}}
Note: $rising_column$ is the placeholder and will be automatically replaced with whatever you enter into the Rising Column field.
Hey,
I was just looking at the same issue.
Theres a hint just below the custom sql query input box
"You can specify the SQL query that is executed against the database yourself. For information on how to specify such a query, see Splunk DB Connect documentation. Example:
SELECT * FROM my_table {{WHERE $rising_column$ > ?}}"
Try replacing "b.id>42813607" in your query with $rising_column$ > ?
Now Im not sure about the importance of the curly braces though
Cheers
Mat
the curly braces are needed!