Skip to contentSkip to conversation

log rendering in real time in audit-viewer

DISCUSSION Xeniya Muratova 4 participants 6 messages Mar 4, 2015 – Mar 30, 2015 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hello Miloslav, and all the guys!

We use audit-viewer for events monitoring.
Unfortunately, if some log is rather big it takes to much time for audit-viewer to parse and render it. Besides, we need to render log updates in real time, i.e. when a new line appears in a log, it should appear in a viewer too. Can you suggest the better way to extend audit-viewer to meet these requirements?
Thanks in advance.

Kseniya Muratova,

#1 lore raw

Hello,

Quoted 9 lines

Hello Miloslav, and all the guys!

We use audit-viewer for events monitoring.
Unfortunately, if some log is rather big it takes to much time for audit-viewer to parse and render it.
Besides, we need to render log updates in real time, i.e. when a new line appears in a log, it should appear in a viewer too.
Can you suggest the better way to extend audit-viewer to meet these requirements?

Well, write the code? Something like inotify could be useful. There isn’t any hidden switch to enable these features, if that is what you are asking.

As for performance, I may have missed something but I think I have squeezed as much as can be done with Python; improving performance further would very likely require a C extension.

(audit-viewer is a PyGtk2 application, and at I’m afraid I don’t currently have plans to port it to GTK+3/gobject-introspection or do any other non-trivial work on the project, at least in the near term.)
Mirek

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

#2 lore raw
Quoted 12 lines · Miloslav Trmač

Hello,

Quoted 9 lines

Hello Miloslav, and all the guys!

We use audit-viewer for events monitoring.
Unfortunately, if some log is rather big it takes to much time for audit-viewer to parse and render it.
Besides, we need to render log updates in real time, i.e. when a new line appears in a log, it should appear in a viewer too.
Can you suggest the better way to extend audit-viewer to meet these requirements?

Quoted 6 lines

Well, write the code? Something like inotify could be useful. There isn’t any hidden switch to enable these features, if that is what you are asking.

As for performance, I may have missed something but I think I have squeezed as much as can be done with Python; improving performance further would very likely require a C extension.

And it also uses the auparse library underneath which might could use some speeding up. There were some performance improvements over the last year. But I don't know if that is enough to be noticeable in a high level application. But it would be another obvious place that could be a performance bottleneck.

-Steve

Quoted 3 lines

(audit-viewer is a PyGtk2 application, and at I’m afraid I don’t currently have plans to port it to GTK+3/gobject-introspection or do any other non-trivial work on the project, at least in the near term.) Mirek

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

This code extends audit-viewer _ParserEventSource to produce UpdatableEventSource (unprivileged).
I have not added this option to SourceDialog, so to see how updating works command line call may be used (python main.py -p -s /path/to/log)

src/event_source.py renamed from event_source.py +102 -2
diff -u -X ex or_src/event_source.py oav/src/event_source.py
@@ -19,7 +19,7 @@
 import datetime
 import os.path
 import re
-
+import os
 import auparse
 
 __all__ = ('ClientEventSource', 'ClientWithRotatedEventSource',
@@ -95,7 +95,7 @@
     '''A source of audit events, reading from an auparse parser.'''
 
     def read_events(self, filters, wanted_fields, want_other_fields,
-                    keep_raw_records):
+                    keep_raw_records, direction = None, tab = None):
         '''Return a sequence of audit events read from parser.
 
         Use filters to select events.  Store wanted_fields in event.fields, the
@@ -265,6 +265,106 @@
     def _create_parser(self):
         return auparse.AuParser(auparse.AUSOURCE_BUFFER, self.str)
 
+class UpdatableEventSourceReader():
+
+    '''A separate reader of audit events, created for each tab of main window.
+    To be used with UpdatableEventSource.
+
+    '''
+
+    def __init__(self, event_source, tab):
+        self.event_source = event_source
+        self.tab = tab
+        self.chunk_size = event_source.chunk_size
+        self.up_file = open(event_source.base_file)
+        self.bottom_file = open(event_source.base_file)
+        self.up_file.seek(0, 2)
+        self.up_pos = self.down_pos = self.up_file.tell()
+
+    def read_down(self):
+        ''' read older lines from file starting from self.down_pos'''
+        if os.path.exists(self.bottom_file.name): 
+            if os.stat(self.bottom_file.name).st_ino != os.fstat(self.bottom_file.fileno()).st_ino:
+                self.bottom_file.close()
+                self.tab.want_read_down = False
+                return ''
+        if self.down_pos <= self.event_source.avg_line_length * self.chunk_size:
+            self.bottom_file.seek(self.down_pos)
+            lines = self.bottom_file.read(self.down_pos)
+            try:
+                files = os.listdir(os.path.dirname(self.event_source.base_file))
+                files = sorted(files, key = lambda x : os.stat(x).st_mtime)
+                filename = self.bottom_file.name
+                self.bottom_file.close()
+                self.bottom_file = open(files[files.index(filename) + 1])
+            except:
+                self.tab.want_read_down = False
+                return ''
+        else:
+            self.bottom_file.seek(self.down_pos - self.event_source.avg_line_length * self.chunk_size)
+            lines = self.bottom_file.read(self.event_source.avg_line_length * self.chunk_size)
+            lines = lines[lines.find('\n') + 1:]
+            self.down_pos -= len(lines)
+        return lines
+
+    def read_up(self):
+        '''try to read new lines if there any after the previous read'''
+        if os.path.exists(self.up_file.name): 
+            if os.stat(self.up_file.name).st_ino != os.fstat(self.up_file.fileno()).st_ino:
+                self.up_file.close()
+                self.up_file = open(self.event_source.base_file)
+                self.up_pos = 0
+        else:
+            self.up_file.close()
+            self.tab.want_read_up = False
+            return ''
+        self.up_file.seek(0, 2)
+        file_end_pos = self.up_file.tell()
+        if self.up_pos != file_end_pos:
+            self.up_file.seek(self.up_pos)
+            if file_end_pos - self.up_pos > self.event_source.avg_line_length*self.chunk_size*5:
+                lines = self.up_file.read(self.event_source.avg_line_length*self.chunk_size)
+                file_end_pos = self.up_file.tell()
+            else:
+                lines = self.up_file.read()
+            if lines.endswith('\n'):
+                self.up_pos = file_end_pos          
+            else:              
+                lines = lines[:lines.rfind('\n') + 1]
+                self.up_pos += len(lines)                   
+            return lines
+        return ''
+
+
+class UpdatableEventSource(_ParserEventSource):
+
+    def __init__(self, base_file, chunk_size = 50, avg_line_length = 74):
+        self.chunk_size = chunk_size
+        self.avg_line_length = avg_line_length
+        self.readers = {}
+        self.base_file = base_file
+        self.current_lines = ''
+
+    def add_tab(self, tab):
+        self.readers[tab] = UpdatableEventSourceReader(self, tab)
+
+    def remove_tab(self, tab):
+        del self.readers[tab]
+
+    def read_events(self, filters, wanted_fields, want_other_fields,
+                    keep_raw_records, direction, tab):
+        if direction == 'up':
+            self.current_lines = self.readers[tab].read_up()
+        else:
+            self.current_lines = self.readers[tab].read_down()
+        return _ParserEventSource.read_events(self, filters, wanted_fields, want_other_fields,
+                    keep_raw_records)
+
+
+    def _create_parser(self):
+        return auparse.AuParser(auparse.AUSOURCE_BUFFER, self.current_lines)
+
+
 def check_expression(expr):
     '''Check expr.
 
src/list_tab.py renamed from list_tab.py +58 -17

136 lines not on this page · raw message

src/main.py renamed from main.py +12 -1
diff -u -X ex or_src/main.py oav/src/main.py
@@ -29,6 +29,7 @@
 from main_window import MainWindow
 import settings
 import util
+import event_source
 
 _ = gettext.gettext
 
@@ -48,12 +49,20 @@
                       help = _('do not attempt to start the privileged backend '
                                'for reading system audit logs'))
     parser.set_defaults(unprivileged = False)
+    parser.add_option('-p', '--updatable', action = 'store_true',
+                      dest = 'updatable',
+                      help = _('read new lines from log '))
+    parser.set_defaults(updatable = False)
+    parser.add_option('-s', '--source', type = 'string',
+                      dest = 'source',
+                      help = _('path to log file '))
     (options, args) = parser.parse_args()
 
     gnome.init(settings.gettext_domain, settings.version)
     gtk.glade.bindtextdomain(settings.gettext_domain, settings.localedir)
     gtk.glade.textdomain(settings.gettext_domain)
 
+    ev_source  = None
     if options.unprivileged:
         cl = None
     else:
@@ -66,7 +75,9 @@
             sys.exit(1)
         except client.ClientNotAvailableError:
             cl = None
+    if options.updatable:
+        ev_source = event_source.UpdatableEventSource(options.source)
 
-    w = MainWindow(cl)
+    w = MainWindow(cl, ev_source)
     if w.setup_initial_window(args):
         gtk.main()
src/main_window.py renamed from main_window.py +17 -7
diff -u -X ex or_src/main_window.py oav/src/main_window.py
@@ -135,6 +135,8 @@
 
         '''
         try:
+            if isinstance(self.event_source, event_source.UpdatableEventSource):
+                self.updater = gobject.idle_add(self.__refresh_all_tabs, True)
             if isinstance(self.event_source, event_source.EmptyEventSource):
                 self.__event_error_report_only_one_push()
                 if self.client is not None:
@@ -246,7 +248,7 @@
         return (filename, extension)
 
     def read_events(self, filters, wanted_fields, want_other_fields,
-                    keep_raw_records):
+                    keep_raw_records, direction  = None, tab = None):
         '''Read audit events.
 
         Return a sequence of events, or None on error (without throwing
@@ -262,7 +264,7 @@
         try:
             return self.event_source.read_events(filters, wanted_fields,
                                                  want_other_fields,
-                                                 keep_raw_records)
+                                                 keep_raw_records, direction, tab)
         except IOError, e:
             if (self.__event_error_report_only_one_depth == 0 or
                 not self.__event_error_reported):
@@ -381,16 +383,24 @@
         '''End a region in which only one error message should be reported.'''
         self.__event_error_report_only_one_depth -= 1
 
-    def __refresh_all_tabs(self):
+    def __refresh_all_tabs(self, updatable = False):
         '''Refresh all tabs, taking care to report errors only once.'''
         self.__event_error_report_only_one_push()
         try:
-            for page_num in xrange(self.main_notebook.get_n_pages()):
-                tab = self.__tab_objects[self.main_notebook
-                                         .get_nth_page(page_num)]
-                tab.refresh()
+            if not updatable:
+                for page_num in xrange(self.main_notebook.get_n_pages()):
+                    tab = self.__tab_objects[self.main_notebook
+                                             .get_nth_page(page_num)]
+                    tab.refresh()
+            else:
+                for page_num in xrange(self.main_notebook.get_n_pages()):
+                    tab = self.__tab_objects[self.main_notebook
+                                             .get_nth_page(page_num)]
+                    tab.refresh(True, 'up')
+                    tab.refresh(True, 'down')
         finally:
             self.__event_error_report_only_one_pop()
+        return True
 
     def __menu_new_list_activate(self, *_):
         self.new_list_tab([])

----- Исходное сообщение -----
От: "mitr" <[email protected]>
Кому: "Xeniya Muratova" <[email protected]> Копия: "linux-audit" <[email protected]> Отправленные: Среда, 4 Март 2015 г 20:50:53 Тема: Re: log rendering in real time in audit-viewer

Hello,

Quoted 9 lines

Hello Miloslav, and all the guys!

We use audit-viewer for events monitoring.
Unfortunately, if some log is rather big it takes to much time for audit-viewer to parse and render it.
Besides, we need to render log updates in real time, i.e. when a new line appears in a log, it should appear in a viewer too.
Can you suggest the better way to extend audit-viewer to meet these requirements?

Well, write the code? Something like inotify could be useful. There isn’t any hidden switch to enable these features, if that is what you are asking.

As for performance, I may have missed something but I think I have squeezed as much as can be done with Python; improving performance further would very likely require a C extension.

(audit-viewer is a PyGtk2 application, and at I’m afraid I don’t currently have plans to port it to GTK+3/gobject-introspection or do any other non-trivial work on the project, at least in the near term.)
Mirek

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

I have fixed bugs in inserting new events, and also added real time rendering option in source dialog, and will be grateful for feedback.

src/audit-viewer.glade renamed from audit-viewer.glade +10 -0
diff -u -X ex or_src/audit-viewer.glade oav/src/audit-viewer.glade
@@ -2664,6 +2664,16 @@
               </widget>
             </child>
             <child>
+              <widget class="GtkCheckButton" id="source_with_updating">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label" translatable="yes">_Render updates in real time</property>
+                <property name="use_underline">True</property>
+                <property name="response_id">0</property>
+                <property name="draw_indicator">True</property>
+              </widget>
+            </child>
+            <child>
               <widget class="GtkVBox" id="vbox25">
                 <property name="visible">True</property>
                 <child>
src/event_source.py renamed from event_source.py +103 -2

123 lines not on this page · raw message

src/list_tab.py renamed from list_tab.py +57 -17

135 lines not on this page · raw message

src/main.py renamed from main.py +12 -1
diff -u -X ex or_src/main.py oav/src/main.py
@@ -29,6 +29,7 @@
 from main_window import MainWindow
 import settings
 import util
+import event_source
 
 _ = gettext.gettext
 
@@ -48,12 +49,20 @@
                       help = _('do not attempt to start the privileged backend '
                                'for reading system audit logs'))
     parser.set_defaults(unprivileged = False)
+    parser.add_option('-p', '--updatable', action = 'store_true',
+                      dest = 'updatable',
+                      help = _('read new lines from log '))
+    parser.set_defaults(updatable = False)
+    parser.add_option('-s', '--source', type = 'string',
+                      dest = 'source',
+                      help = _('path to log file '))
     (options, args) = parser.parse_args()
 
     gnome.init(settings.gettext_domain, settings.version)
     gtk.glade.bindtextdomain(settings.gettext_domain, settings.localedir)
     gtk.glade.textdomain(settings.gettext_domain)
 
+    ev_source  = None
     if options.unprivileged:
         cl = None
     else:
@@ -66,7 +75,9 @@
             sys.exit(1)
         except client.ClientNotAvailableError:
             cl = None
+    if options.updatable:
+        ev_source = event_source.UpdatableEventSource(options.source)
 
-    w = MainWindow(cl)
+    w = MainWindow(cl, ev_source)
     if w.setup_initial_window(args):
         gtk.main()
src/main_window.py renamed from main_window.py +23 -7
diff -u -X ex or_src/main_window.py oav/src/main_window.py
@@ -135,6 +135,8 @@
 
         '''
         try:
+            if isinstance(self.event_source, event_source.UpdatableEventSource):
+                self.updater = gobject.idle_add(self.update_tabs)
             if isinstance(self.event_source, event_source.EmptyEventSource):
                 self.__event_error_report_only_one_push()
                 if self.client is not None:
@@ -246,7 +248,7 @@
         return (filename, extension)
 
     def read_events(self, filters, wanted_fields, want_other_fields,
-                    keep_raw_records):
+                    keep_raw_records, direction  = None, tab = None):
         '''Read audit events.
 
         Return a sequence of events, or None on error (without throwing
@@ -262,7 +264,7 @@
         try:
             return self.event_source.read_events(filters, wanted_fields,
                                                  want_other_fields,
-                                                 keep_raw_records)
+                                                 keep_raw_records, direction, tab)
         except IOError, e:
             if (self.__event_error_report_only_one_depth == 0 or
                 not self.__event_error_reported):
@@ -381,16 +383,30 @@
         '''End a region in which only one error message should be reported.'''
         self.__event_error_report_only_one_depth -= 1
 
-    def __refresh_all_tabs(self):
+    def update_tabs(self):
+        self.__refresh_all_tabs(True)
+        return True
+
+    def __refresh_all_tabs(self, updating = False):
         '''Refresh all tabs, taking care to report errors only once.'''
         self.__event_error_report_only_one_push()
         try:
-            for page_num in xrange(self.main_notebook.get_n_pages()):
-                tab = self.__tab_objects[self.main_notebook
-                                         .get_nth_page(page_num)]
-                tab.refresh()
+            if not updating:
+                for page_num in xrange(self.main_notebook.get_n_pages()):
+                    tab = self.__tab_objects[self.main_notebook
+                                             .get_nth_page(page_num)]
+                    tab.refresh()
+            else:
+                for page_num in xrange(self.main_notebook.get_n_pages()):
+                    tab = self.__tab_objects[self.main_notebook
+                                             .get_nth_page(page_num)]
+                    if tab.want_read_up:
+                        tab.refresh(True, 'up')
+                    if tab.want_read_down:
+                        tab.refresh(True, 'down')
         finally:
             self.__event_error_report_only_one_pop()
+        return True
 
     def __menu_new_list_activate(self, *_):
         self.new_list_tab([])

Only in oav/src/: patch

src/source_dialog.py renamed from source_dialog.py +26 -3
diff -u -X ex or_src/source_dialog.py oav/src/source_dialog.py
@@ -39,7 +39,8 @@
                            'source_path', 'source_path_browse',
                            'source_path_label',
                            'source_type_file', 'source_type_log',
-                           'source_with_rotated')
+                           'source_with_rotated',
+                           'source_with_updating')
 
     def __init__(self, parent, client):
         DialogBase.__init__(self, 'source_dialog', parent)
@@ -58,6 +59,8 @@
                              self.__source_type_log_toggled)
         util.connect_and_run(self.source_type_file, 'toggled',
                              self.__source_type_file_toggled)
+        util.connect_and_run(self.source_with_updating, 'toggled',
+                             self.__source_with_updating_toggled)
         self._setup_browse_button(self.source_path_browse, self.source_path,
                                   _('Audit Log File'),
                                   gtk.FILE_CHOOSER_ACTION_OPEN)
@@ -102,13 +105,20 @@
             self.source_with_rotated.set_active(False)
             self.source_type_file.set_active(True)
             self.source_path.set_text(source.path)
+        elif isinstance(source, event_source.FileWithRotatedEventSource):
+            self.source_with_rotated.set_active(True)
+            self.source_type_file.set_active(True)
+            self.source_path.set_text(source.base)
         else:
             assert isinstance(source,
-                              event_source.FileWithRotatedEventSource), \
+                              event_source.UpdatableEventSource), \
                 'Unexpected event source'
             self.source_with_rotated.set_active(True)
+            self.source_with_rotated.set_sensitive(False)
+            self.source_type_log.set_sensitive(False)
             self.source_type_file.set_active(True)
             self.source_path.set_text(source.base)
+            self.source_with_updating.set_active(True)
 
     def save(self, main_window):
         '''Modify main_window to reflect dialog state.'''
@@ -124,7 +134,10 @@
                 source = event_source.ClientEventSource(self.client, name)
         else:
             path = self.source_path.get_text()
-            if self.source_with_rotated.get_active():
+            if self.source_with_updating.get_active():
+                source = event_source.UpdatableEventSource(path)
+                main_window.updater = gobject.idle_add(main_window.update_tabs)
+            elif self.source_with_rotated.get_active():
                 source = event_source.FileWithRotatedEventSource(path)
             else:
                 source = event_source.FileEventSource(path)
@@ -175,11 +188,21 @@
                 if it is not None:
                     self.source_log.set_active_iter(it)
 
+    def __source_with_updating_toggled(self, *_):
+        is_set =  self.source_with_updating.get_active()
+        self.source_with_rotated.set_sensitive(not is_set)
+        self.source_type_log.set_sensitive(not is_set)
+        if is_set:
+            self.source_type_file.set_active(True)
+            self.source_type_log.set_active(False)
+            self.source_with_rotated.set_active(True)
+
     def __source_type_file_toggled(self, *_):
         util.set_sensitive_all(self.source_type_file.get_active(),
                                self.source_path_label, self.source_path,
                                self.source_path_browse)
 
+
     def __window_destroy(self, *_):
         self.emit('destroy')
         return False
src/event_source.py renamed from event_source.py +103 -2

123 lines not on this page · raw message

src/list_tab.py renamed from list_tab.py +57 -17

135 lines not on this page · raw message

src/main.py renamed from main.py +12 -1
diff -u -X ex or_src/main.py oav/src/main.py
@@ -29,6 +29,7 @@
 from main_window import MainWindow
 import settings
 import util
+import event_source
 
 _ = gettext.gettext
 
@@ -48,12 +49,20 @@
                       help = _('do not attempt to start the privileged backend '
                                'for reading system audit logs'))
     parser.set_defaults(unprivileged = False)
+    parser.add_option('-p', '--updatable', action = 'store_true',
+                      dest = 'updatable',
+                      help = _('read new lines from log '))
+    parser.set_defaults(updatable = False)
+    parser.add_option('-s', '--source', type = 'string',
+                      dest = 'source',
+                      help = _('path to log file '))
     (options, args) = parser.parse_args()
 
     gnome.init(settings.gettext_domain, settings.version)
     gtk.glade.bindtextdomain(settings.gettext_domain, settings.localedir)
     gtk.glade.textdomain(settings.gettext_domain)
 
+    ev_source  = None
     if options.unprivileged:
         cl = None
     else:
@@ -66,7 +75,9 @@
             sys.exit(1)
         except client.ClientNotAvailableError:
             cl = None
+    if options.updatable:
+        ev_source = event_source.UpdatableEventSource(options.source)
 
-    w = MainWindow(cl)
+    w = MainWindow(cl, ev_source)
     if w.setup_initial_window(args):
         gtk.main()
src/main_window.py renamed from main_window.py +23 -7
diff -u -X ex or_src/main_window.py oav/src/main_window.py
@@ -135,6 +135,8 @@
 
         '''
         try:
+            if isinstance(self.event_source, event_source.UpdatableEventSource):
+                self.updater = gobject.idle_add(self.update_tabs)
             if isinstance(self.event_source, event_source.EmptyEventSource):
                 self.__event_error_report_only_one_push()
                 if self.client is not None:
@@ -246,7 +248,7 @@
         return (filename, extension)
 
     def read_events(self, filters, wanted_fields, want_other_fields,
-                    keep_raw_records):
+                    keep_raw_records, direction  = None, tab = None):
         '''Read audit events.
 
         Return a sequence of events, or None on error (without throwing
@@ -262,7 +264,7 @@
         try:
             return self.event_source.read_events(filters, wanted_fields,
                                                  want_other_fields,
-                                                 keep_raw_records)
+                                                 keep_raw_records, direction, tab)
         except IOError, e:
             if (self.__event_error_report_only_one_depth == 0 or
                 not self.__event_error_reported):
@@ -381,16 +383,30 @@
         '''End a region in which only one error message should be reported.'''
         self.__event_error_report_only_one_depth -= 1
 
-    def __refresh_all_tabs(self):
+    def update_tabs(self):
+        self.__refresh_all_tabs(True)
+        return True
+
+    def __refresh_all_tabs(self, updating = False):
         '''Refresh all tabs, taking care to report errors only once.'''
         self.__event_error_report_only_one_push()
         try:
-            for page_num in xrange(self.main_notebook.get_n_pages()):
-                tab = self.__tab_objects[self.main_notebook
-                                         .get_nth_page(page_num)]
-                tab.refresh()
+            if not updating:
+                for page_num in xrange(self.main_notebook.get_n_pages()):
+                    tab = self.__tab_objects[self.main_notebook
+                                             .get_nth_page(page_num)]
+                    tab.refresh()
+            else:
+                for page_num in xrange(self.main_notebook.get_n_pages()):
+                    tab = self.__tab_objects[self.main_notebook
+                                             .get_nth_page(page_num)]
+                    if tab.want_read_up:
+                        tab.refresh(True, 'up')
+                    if tab.want_read_down:
+                        tab.refresh(True, 'down')
         finally:
             self.__event_error_report_only_one_pop()
+        return True
 
     def __menu_new_list_activate(self, *_):
         self.new_list_tab([])

----- Исходное сообщение -----
От: "mitr" <[email protected]>
Кому: "Xeniya Muratova" <[email protected]> Копия: "linux-audit" <[email protected]> Отправленные: Среда, 4 Март 2015 г 20:50:53 Тема: Re: log rendering in real time in audit-viewer

Hello,

Quoted 9 lines

Hello Miloslav, and all the guys!

We use audit-viewer for events monitoring.
Unfortunately, if some log is rather big it takes to much time for audit-viewer to parse and render it.
Besides, we need to render log updates in real time, i.e. when a new line appears in a log, it should appear in a viewer too.
Can you suggest the better way to extend audit-viewer to meet these requirements?

Well, write the code? Something like inotify could be useful. There isn’t any hidden switch to enable these features, if that is what you are asking.

As for performance, I may have missed something but I think I have squeezed as much as can be done with Python; improving performance further would very likely require a C extension.

(audit-viewer is a PyGtk2 application, and at I’m afraid I don’t currently have plans to port it to GTK+3/gobject-introspection or do any other non-trivial work on the project, at least in the near term.)
Mirek

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

#7 lore raw
In reply to Xeniya Muratova

Free or pay for solutions? You have products like splunk and greybar that do a good job. Managengine also has a log viewer that works OK. You will just need to pass audit logs to syslog to use most products. -
Ray Pittigher
--Exelis Inc, Clifton NJ
--phone 973-284-2275
--email [email protected]
________________________________________
From: [email protected] [[email protected]] on behalf of Xeniya Muratova [[email protected]]
Sent: Wednesday, March 04, 2015 8:42 AM
To: [email protected]; [email protected]
Subject: log rendering in real time in audit-viewer

Hello Miloslav, and all the guys!

We use audit-viewer for events monitoring.
Unfortunately, if some log is rather big it takes to much time for audit-viewer to parse and render it. Besides, we need to render log updates in real time, i.e. when a new line appears in a log, it should appear in a viewer too. Can you suggest the better way to extend audit-viewer to meet these requirements?
Thanks in advance.

Kseniya Muratova,

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

________________________________

This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Exelis Inc. The recipient should check this e-mail and any attachments for the presence of viruses. Exelis Inc. accepts no liability for any damage caused by any virus transmitted by this e-mail.