This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL Delete of Syslog entries

I had a single device generate alot of Syslog entries and I was going to just go into the DB and delete those entries associated with that device from the syslog table using SQL Delete. I know the recommendation from SW is normally to use the Truncate command to do this sort of thing.  Any reason I should not use SQL Delete directly ??

  • I can't think of any good reason not to do this.  I manage my syslog messages on a daily basis through this method.

  • Hi,

    TRUNCATE should only be used if you really need to get rid of all the data in your table, which is hopefully extremely rare.  If you want to get rid of Syslog entries from a specific node or IP address then use a DELETE statement.  Please only do this if you are very comfortable using SQL and do a backup of your table if you feel it is necessary before executing the statement.

    Best practice is to execute a SELECT statement first to see what you are going to be deleting:

    SELECT * FROM dbo.SysLog WHERE IP = '10.10.10.10'

    Noting the risks, a sample statement for this would be:

    DELETE FROM dbo.SysLog WHERE IP = '10.10.10.10'

    Replacing the IP address with the IP address of the Node that you want to remove the Syslog entries for.

    Deletes are permanent so please be aware of this and change the SQL if you need to narrow the scope of the delete. 

    Thanks

  • Thanks Karlo. Straight to the point.