Some error about getting data from chrome history log


#1 lida02@megvii.com

I want collect chrome histroy log, follow the https://docs.nxlog.co/userguide/integrate/browser-history.html#google-chrome-history-location-and-details guide on windows terminal, because the http://www.ch-werner.de/ site is down, so I can't download “SQLite ODBC Driver”,but i found another substitution  https://www.devart.com/odbc/sqlite/download.html , I don't know if this driver is not as same as  “SQLite ODBC Driver”. But when I run nxlog, I got some error info.

2023-02-14 11:23:25 INFO [im_odbc|odbc] im_odbc successfully connected to the database2023-02-14 11:23:25 WARNING [im_odbc|odbc] im_odbc detected a disconnection, attempting to reconnect in 10 seconds2023-02-14 11:23:25 ERROR [im_odbc|odbc] SQLExecute failed, 22001:2:390:[Devart][ODBC]String data, right-truncated (odbc error code: -1) 

my input conf like below

<Input odbc>   Module              im_odbc   PollInterval        1200   ConnectionString    DRIVER=Devart ODBC Driver for SQLite; Database=D:\ProgramFiles\logs\History_Chrome;Version=3;   SQL               Select visits.id AS id,urls.url AS URL,urls.title AS Title FROM visits INNER JOIN urls ON visits.url = urls.id WHERE visits.id > ?   Exec                $Hostname = hostname();   Exec                to_json();</Input>

I want to know what's wrong with my config ,or how to fix it.

 

#2 gahorvath Nxlog ✓

Hi there,

I cleaned up the info you posted below:

2023-02-14 11:23:25 INFO [im_odbc|odbc] im_odbc successfully connected to the database
2023-02-14 11:23:25 WARNING [im_odbc|odbc] im_odbc detected a disconnection, attempting to reconnect in 10 seconds
2023-02-14 11:23:25 ERROR [im_odbc|odbc] SQLExecute failed, 22001:2:390:[Devart][ODBC]String data, right-truncated (odbc error code: -1) 

<Input odbc>
Module im_odbc
PollInterval 1200
ConnectionString DRIVER=Devart ODBC Driver for SQLite; Database=D:\ProgramFiles\logs\History_Chrome;Version=3;
SQL Select visits.id AS id,urls.url AS URL,urls.title AS Title FROM visits INNER JOIN urls ON visits.url = urls.id WHERE visits.id > ? Exec $Hostname = hostname(); Exec to_json(); </Input>

It looks like the position passed via ? is wider than the column visits.id

It seems somewhat strange because it was supposed to have been read out from that very column.

Can you try and use this query with an ODBC SQL client using the same config to query that sqlite DB?

I that works, we have a bug in NXLog or something broke in the agent.

Running NXLog in debug mode would show the actual values used in the query.

You could also try to reset the agent, by deleting configcache.dat

Sorry I could not be more specific.

 

Gabor