Synchronous viewing of several log files - viewer

My embedded system is connected to a Linux computer via a serial interface and produces multiple text log files with lines, prepended by a timestamp. I'd like to view several such files off-line simultaneously and keep them visually synchronized by time - if a scroll one, the rest are scrolled too, based on the timestamps. Is there an off-the-shelf viewer to do that? If not - what could be the minimum effort way to do that?
Thanks in advance.

Chainsaw gives you the ability to tail multiple files at the same time.
Chainsaw also supports something like a database 'view', where you can tell Chainsaw to aggregate events from the various sources into a single table, through the 'View, create tab from expression' menu option.
For example, if all of your log files share a common logger hierarchy (com.mycompany.blah.blah), you could define an expression with your root logger as the expression in order to get all events from all files with that logger into a single table:
logger ~= com.mycompany
Or, if you want all of the events from all of the sources, just give it a non-expression (just a text name), although you'll need to pause the chainsaw-log tab or you'll get Chainsaw log messages as well:
ALL
You can also control how events that are received from these files end up in the UI. By default, the events for each file end up in its own tab..however, this is configurable via the 'tab name/event routing expression' in preferences.
And while it probably isn't what you're looking for, you can 'undock' individual tabs and lay them out on-screen to see them all at the same time, but Chainsaw won't 'sync' as you scroll.
If you are interested, try the latest developer snapshot of Chainsaw - it has a lot of additional features and improved usability over what is currently released:
http://people.apache.org/~sdeboy

If you are viewing logs on Windows, Logparser http://logparserplus.com/Examples, a free command line tool from Microsoft, has some crazy capabilities with standard logs.
I had to develop an in-house tool to deal with multiple log files, and it makes some use of Logparser, to produce a master log file of interesting (or all) events. Handling proprietary time stamps, and logs from multiple time zones!

Related

SoapUI - Removing timestamp from the script log

Is it possible to remove the time stamp from the script log in SoapUI? I am printing maybe important information there and the time stamp makes it look really messy. Tabbing and creating new lines using escape sequences do not properly format text in the script log so this approach is not possible
SoapUI, out of the box, cannot turn off the timestamp in logs. This is a feature provided by log4j, which SoapUI utilizes for writing the logs. Further, this feature is highly desirable for searching relevant information from the logs.
One option is to create / utilize a script mechanism of your own, which logs only information that is relevant to you. Possibly just dumping relevant information into a .csv file, and then port-processing that with something like Excel.
Alternatively, you could use a tool such as awk (or any scripting language, even Groovy) to post-process the log file, extracting only the information that is relevant to you.

How could Visual Studio 2012 be set to use a custom tool to customise the Reading/writing of existing editors?

Update: It appears that VS doesn't have the hooks needed to do what is needed in my use case. However there are a couple of options that could work for other people and as such I'm marking the question as answered but I would love to find a solution that works for me.
We have encrypted files that are routinely kept in encrypted form within source control (TFS). When I want to compare versions I use Beyond Compare and have added the encryption/decryption tool as filtering on the read/write process to allow plain text viewing and editing.
However if I just want to open the file for reading/editing it's a bit tedious using a dummy comparison just to view/edit the file.
As such as I wondering if there is a configuration setting or way in Visual Studio that would allow me to insert a filter on the read/write so that it could display/edit/save files that would otherwise be unreadable.
Edit:
*NB: The encryption aspect is just single use case *, I'm actually looking for a generic answer that doesn't require writing an editor to replace the editors within VS that already exist such as the MS supplied XML editor or the custom third party ones.
I have both custom and non custom files that are encrypted. Each file type already has an editor. We have no access to the source for any of these editors. The problem is that the file is encrypted in TFS, and all I need is the filtering on the read and write for all files regardless of editor.
I want to use all the existing features of the installed editors without change. Only the reading and writing need to be customised.
Here's a potentially hacky way to achieve what you are trying to do, if there is no other easy option.
TFS stores data in a SQL database. Therefore you can theoretically modify the read/edit command that is used to extract the data from TFS and send it to the editor/viewer. This might involve modifying a stored procedure, or putting a trigger in place to modify the data before it is presented to the editor.
You would need to run a Profiler Trace on the TFS database when you click on edit/view or browse to the node in the source control tree. This will help you to figure out what data TFS is accessing and what functions/stored procs/tables etc it used to extract said data.
The same in reverse; you'd need to modify the 'writing' of the data to use your custom tool before putting it in the DB.
SQL has the ability to call CLR code, so you could use your tool if it's written in .NET.
The easiest way would be to download the 2012 SDK, Microsoft already provide a nice walkthrough on how to implement your custom editor HERE.
The process is:
Install the SDK
Fire up VS2012; Select New Project -> Other Proj Types -> Visual Studio Package
Visual C#, company name, etc...
Tick the "Custom Editor" tickbox
Fill in the rest of the details
So now you're presented with all the source of a vanilla text editor, and the part you want to hook in to is the IPersistFileFormat::Load() and IPersistFileFormat::Save() functions found under EditorPane.cs and put your encryption/decryption routines in there, thus you'll be left with a text editor with a custom encrypted file format.
This may not do what you need, since you need to call third party exe. However this answer may be useful for others that have access to source code (or a dll or library).
You could write a file system filter that encrypts/ decrypts the data to and from disk. Note that the driver sits at the OS level, and is outside of Visual Studio.
From the MSDN article File Systems and File System Filter Drivers:
A file system filter driver intercepts requests targeted at a file system or another file system filter driver. By intercepting the request before it reaches its intended target, the filter driver can extend or replace functionality provided by the original target of the request. Examples of File Systems and File System Filter Drivers include anti-virus filters, backup agents, and encryption products.
See this Code Project article for a tutorial: File System Filter Driver Tutorial. The article does not show how to do encryption/ decryption, but shows how to get a simple driver up and running.
There are extensions that will capture events to the current window save for example and what turns out to be document load. ** This is not a custom editor **
check out the following two links:
http://msdn.microsoft.com/en-us/library/dd885244.aspx
and a fairly complete open source addin that works with files when saved (regardless of type)
https://bitbucket.org/s_cadwallader/codemaid/src/7cf1bf6108801f48b85e30d85e1646fbc73ba889/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs?at=default
which hooks the RDT table to extend the current environment. You would need to adjust from here of course but this should get you going in the right direction.

Search through scripts of (multiple) cimplicity screens

We are using Cimplicity to operate some installations at our plant. The frontend consists of a lot of .cim files, which are the screens presented to the operator. These files are built with 'cimedit', which is basically a graphical click and drag program with which you can assemble the screens. Each object you drag onto the screen has the option to run a script, which brings me to my problem.
Because each screen contains a lot of small scripts and functions it is hard to keep track of what does what. For example I'm trying to figure out where a certain table from my database is being accessed or updated. Since the files all seem to be compressed (or so) I can't use a regular 'search the contents of this file' search.
Things I've tried so far are searching using windows, with the content option enabled and also tried the compression option. This had no success. It makes sense because like I said, the files seem to be compressed, so the actual script is not stored in plain text.
So, my question in short:
How do I search all the scripts of (preferably multiple) cimplicity screens?
Any tips on how to search compressed files are also very much appreciated.
I stumbled upon another stackoverflow post while searching for a better windows search tool and ended up finding this post: https://superuser.com/questions/26593/best-way-to-confidently-search-files-and-contents-in-windows-without-using-an
This posts recommends Agent Ransack and it is actually possible to search through the .cim files with this tool.

DDE/IPC in linux gui?

There used to be Dynamic Data Exchange API (type of IPC) in windows which allowed sending notifications with params to running process and they would grab focus and conduct the operation. Is there anything similar in xwindows/gnome?
Like for example, when I get my phpunit errors, it comes with file path and line number. Was wondering if using any bash script or perl etc, I could grab the output and make the line below clickable
protected/tests/controllers/CmsControllerTest.php:17
so it quickly focus on my eclipse, open the file and moves cursor to the right line number.
phpunit and eclipse is just for examples. enough said.
The usual way to address this, would be to make the functionality an eclipse plugin.
There are lots of examples on how to write such plugins.
Moreover, you can probably lean on/reuse rather feature complete existing views (Problems view, Tasks view etc.) so making it look beautiful and matching eclipse should be a breeze.
Alternatively, there is a rich API that you could use to implement your own IPC channel to talk with your test runner outside Eclipse. An example of that is eclimd, the Vim-eclipse integration thing. Specifically, look at it's behaviour in 'Headed Eclipse' mode.

How to download specific files / skip files in rtorrent or other linux program?

I have been searching quite hard but cannot find an answer to this...
Are there any torrent programs out there for linux (centos) where you can skip certain files from the torrent OR download specific files? Or if not that skip files under or over a certain size?
I have checked rtorrent and bittorrent but neither seem to have this feature.
This needs to be automated so preferably like this:
./bittorrent --file='http://example.blah/filename.torrent' --skip'file1.jpg,file2.jpg'
OR
./bittorrent --file='http://example.blah/filename.torrent' --skip > 1MB
I appreciate your answers :)
thanks!
rtorrent does allow you to control which file from a torrent to download from the 'File list' view. From the main view get there by selecting the particular torrent using up/down arrow keys so it is stared, then hit right arrow to view details, then down arrow to select 'File list', followed by right arrow to allow you to navigate the file list. Once you are in the list of files you move up/down with the arrows keys to select the file in question. Then hit the space-bar to toggle through the 'file priority' options of whether the file is 'hig' (i.e. High priority),'off' (i.e. don't download), or blank (i.e. 'normal'). The 'off' setting allows you skip the file(s) in question.
once you're in the file list view you can select the file that you don't want to download (using arrow keys) then toggle (using the space bar) the priority to off.
For proper automation you'd probably want to script it in python or ruby using some torrent library, but if it's generally more flexible file selection that you're after, then you could try utilizing the web interfaces that many torrent clients offer.
As an example using Tixati client and a hypothetical torrent where there's hundreds of directories that each have a subdirectory that you don't want (let's say it's called "RUS"). So, after enabling web interface from Tixati settings, you'd go to localhost:8888, open a javascript console and write something like this:
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
$('.xferstable tr:has(td)').each(function(i,td){
var fname= $('td:eq(1)', td).text();
$('input', td).prop('checked', fname.match(/\\RUS\\/) == null);
})
You can visually verify that it selected the files you wanted and click Apply, et voilĂ .
You can do this using Transmission

Resources