Help with large tables and multi-line JSON rendering

Hello,

I’m pretty new to Textualize and yet I managed to put together a small application that can display the contents of the /var/log/suricata/eve.json file in different formats (table, JSON, etc.) using filters (SuricataLog); the framework is awesome.

Now to my issue: The files I’m trying to display can be quite large and I would love to provide some feedback about back to the user (as opposed of freezing for a few seconds only to display the contents on a scroll-able pane .

Here are my questions:

  1. It is better to re-create the table over and over as we get contents or I can add rows to it until I’m done? I don’t fully understand how the module can refresh while I send more rows in the background
  2. I also send JSON data back to the user. This one is trickier because I cannot render single JSON line but I need to keep appending contents, so the final render is a scroll-able JSON document, made of multiple JSON lines

For question #1 I think I may be able to do it by returning an empty table while I populate the contents with background thread, for question #2 no idea what type of container can do what I want in textualize.

Happy to discuss my code, you can see the class here: EveLogApp

Thanks in advance!,

–Jose

You can add new rows to a table then render it again. You may have to call update() with the table again to force a render.

Don’t fully understand your requirements for the JSON…

Hello Will,

I’ll follow your advise about the table update, please ignore for now my question about the JSON part (will break this broom one stick at the time).

Thanks!

—Jose