<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Index on syslog for container and/or subnet?]]></title><description><![CDATA[<p dir="auto">If I select a single node and right click to get to syslog it loads really quickly.  If I right click on a container or subnet and view syslog it never seems to complete.  I haven't looked at the SQL but I assume there are missing indexes for container/subnet and its doing a full table scan?</p>
<p dir="auto">I came across this old thread talking about adding the indexes to source: <a href="/topic/4886">https://www.netxms.org/forum/feature-requests/syslog-table-index/</a></p>
<p dir="auto">Is it feasible to add one to containers and/or subnets too?</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://forum.netxms.org/topic/6186/index-on-syslog-for-container-and-or-subnet</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 12:45:14 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6186.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Sep 2019 05:37:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Index on syslog for container and/or subnet? on Wed, 25 Sep 2019 08:27:22 GMT]]></title><description><![CDATA[<p dir="auto">For searches like that, I manually open the Syslog window and add my constraints before searching.<br />
That's for the same reason you mentioned: if you don't, it will go through the entire syslog table (even if it only returns the latest 4000 lines or something like that).<br />
A default to limit Syslog (and SNMP Trap and Event Log) output to anything newer than a configurable (Server Side? Client Side? Both?) interval would be a huge improvement for that.</p>
]]></description><link>https://forum.netxms.org/post/26609</link><guid isPermaLink="true">https://forum.netxms.org/post/26609</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Wed, 25 Sep 2019 08:27:22 GMT</pubDate></item><item><title><![CDATA[Reply to Index on syslog for container and/or subnet? on Wed, 25 Sep 2019 07:26:04 GMT]]></title><description><![CDATA[<p dir="auto">Looking at the query in postgres we have a large syslog table (&gt;20GB), and it seems the main issue is the scan back through all timestamps by default when right clicking on a zone or subnet and choosing syslog:</p>
<pre><code>netxms=# explain SELECT msg_timestamp,source_object_id,zone_uin,facility,severity,hostname,msg_tag,msg_text FROM syslog WHERE msg_id&lt;=399610423 AND (source_object_id IN (45902, 45930, 45940, 45948, 45953, 45967, 46061, 46106, 46107, 46109)) ORDER BY msg_timestamp DESC LIMIT 1000;
                                                                    QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.57..15744.67 rows=1000 width=160)
   -&gt;  Index Scan Backward using idx_syslog_msg_timestamp on syslog  (cost=0.57..18440640.31 rows=1171273 width=160)
         Filter: ((msg_id &lt;= 399610423) AND (source_object_id = ANY ('{45902,45930,45940,45948,45953,45967,46061,46106,46107,46109}'::integer[])))
(3 rows)
</code></pre>
<p dir="auto">If I manually build a search in the syslog window its a much shorter scan (and a lightly different query constructed):</p>
<pre><code>netxms=# explain SELECT msg_timestamp,source_object_id,zone_uin,facility,severity,hostname,msg_tag,msg_text FROM syslog WHERE msg_id&lt;=399611781 AND ((source_object_id = 45948) OR (source_object_id = 45940) OR (source_object_id = 45930) OR (source_object_id = 46109) OR (source_object_id = 46107) OR (source_object_id = 46106)) AND (msg_timestamp BETWEEN 1569333600 AND 1569419999) ORDER BY msg_timestamp DESC LIMIT 1000;
                                                                                                           QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.57..1418.03 rows=48 width=160)
   -&gt;  Index Scan Backward using idx_syslog_msg_timestamp on syslog  (cost=0.57..1418.03 rows=48 width=160)
         Index Cond: ((msg_timestamp &gt;= 1569333600) AND (msg_timestamp &lt;= 1569419999))
         Filter: ((msg_id &lt;= 399611781) AND ((source_object_id = 45948) OR (source_object_id = 45940) OR (source_object_id = 45930) OR (source_object_id = 46109) OR (source_object_id = 46107) OR (source_object_id = 46106)))
(4 rows)
</code></pre>
<p dir="auto">Could there be a preference to set a default date range for syslog/event log searches (so that any right click of a container/subnet/zone defaults to say 1 day or 1 week).  Or could you not immediately execute the search when right clicking and instead take you to the populated syslog search window to allow you to enter a time range?</p>
<p dir="auto">Or is there some index-fu that could speed this up?</p>
<p dir="auto">Not sure what the most usable approach is here.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://forum.netxms.org/post/26607</link><guid isPermaLink="true">https://forum.netxms.org/post/26607</guid><dc:creator><![CDATA[normalcy]]></dc:creator><pubDate>Wed, 25 Sep 2019 07:26:04 GMT</pubDate></item></channel></rss>