Export Query Log

Post Reply
mmcfadden
Posts: 158
Joined: Tue May 20, 2003 2:17 pm

Export Query Log

Post by mmcfadden »

I would like a way to manually export the query log to a comma delimited text file. I would prefer to accomplish this with an external script and seperate this process from the Dowalk script. Is there something like this that is already available? If not how difficult would this be. Ultimately I would like to import this file into MS Access for analysis. Any help would be greatly appreciated.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Export Query Log

Post by mark »

You can write a simple script to get the data. If you tell the script the database you won't even have to query the profile to find the right database. You can use one of <sql>'s automatic output formatters such as output=xml or you can output whatever you want.

<script language=vortex>
<a name=main>
<db=$db><!-- give "db" on the command line or environment -->
<sql row "select * from querylog">
<fmt "%at" "%Y-%m-%d %H:%M:%S" $id>,$Client,$Query
</sql>
</a>
</script>

You might want to use something other than , that might appear in a query, or escape commas before printing.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Export Query Log

Post by John »

You may also want to look at the genqlogexcel function
in dowalk as a starting point. It generates tab separated data and does some preprocessing to the data.
John Turnbull
Thunderstone Software
Post Reply