SoapUI - Removing timestamp from the script log - groovy

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.

Related

How to stream log files content that is constantly changing file names in perl?

I a series of applications on Linux systems that I need to basically constantly 'stream' out or even just 'tail' out but the challenge is the filenames are constantly rolling and changing.
The are all date encoded (dates being in different formats) and each then have different incremented formats.
Most of them start with one and increase, but one doesn't have an extension and then adds an extension past the first file and the other increments a number but once hitting 99 rolls to increment a alpha and returns the numeric to 01 and then up again as it rolls so quickly.
I just have the OS level shell scripting, OS command line utilities, and perl available to me to handle this situation for another application to pickup and read these logs.
The new files are always created right when it starts writing to the new file and groups of different logs (some I am reading some I am not) are being written to the same directory so I cannot just pickup anything hitting the directory.
If I simply 'tail -n 1000000 -f |' them today this works fine for the reader application I am using until the file changes and I cannot setup file lists ranges within the reader application, but can pre-process them so they basically appear as a continuous stream to the reader vs. the reader directly invoking commands to read them. A simple Perl log reader like this also work fine for a static filename but not for dynamic ones. It is critical I don't re-process any logs lines and just capture new lines being written to the logs.
I admit I am not any form a Perl guru, and the best answers / clue I've been able to find so far is the use of Perl's Glob function to possibly do this but the examples I've found basically reprocess all of the files on each run then seem to stop.
Example File Names I am dealing with across multiple apps I am trying to handle..
appA_YYMMDD.log
appA_YYMMDD_0001.log
appA_YYMMDD_0002.log
WS01APPB_YYMMDD.log
WS02APPB_YYMMDD.log
WS03AppB_YYMMDD.log
APPCMMDD_A01.log
APPCMMDD_B01.log
YYYYMMDD_001_APPD.log
As denoted above the files do not have the same inode and simply monitoring the directory for change is not possible as a lot of things are written there. On the dev system it has more than 50 logs being written to the directory and thousands of files and I am only trying to retrieve 5. I am seeing if multitail can be made available to try that suggestion but it is not currently available and installing any additional RPMs in the environment is generally a multi-month battle.
ls -i
24792 APPA_180901.log
24805 APPA__180902.log
17011 APPA__180903.log
17072 APPA__180904.log
24644 APPA__180905.log
17081 APPA__180906.log
17115 APPA__180907.log
So really the root of what I am trying to do is simply a continuous stream regardless if the file name changes and not have to run the extract command repeatedly nor have big breaks in the data feed while some script figures out that the file being logged to has changed. I don't need to parse the contents (my other app does that).. Is there an easy way of handling this changing file name?
How about monitoring the log directory for changes with Linux inotify, e.g. Linux::inotify2? Then you could detect when new log files are created, stop reading from the old log file and start reading from the new log file.
Try tailswitch. I created this script to tail log files that are rotated daily and have YYYY-MM-DD on their names. To use this script, you just say:
% tailswitch '*.log'
The quoting prevents the shell from interpreting the glob pattern. The script will perform glob pattern from time to time to switch to a newer file based on its name.

How to customize groovy console output in such a way that it is applicable to all the groovy script running?

I have been working on this for some time now and have not been able to get to a proper conclusion. I need to customize the groovy console output, for instance, for every output line, I need to show the time and date. And also I need to print the warnings,errors and exceptions in a particular format. And I need this format to be enabled for all the groovy scripts I run on my computer. Is there some thing like a configuration file where I can change the output format and customize it?? Hope I have been able to put across my question properly. Thanks in advance :)

Serialized Printing Method

I am looking for a method by which I can print one document, and have a field that is incremented on each copy printed. I currently run linux, so bash in concert with several programs might be the way to go, but I'm just not sure where to start.
I have a document that is used for our business that currently is hand stamped for serialization... We would like to simply print them but cant find a method by which to increment a specific field. I would like to use either a PDF or an ODF/ODT for the document.
Thanks for any help you can give!
How is the document produced at the first place?
If you master that process, you could certainly add serialization at that level. For instance if using LibreOffice you could do that in LibreOffice. If using a text formatter (like LaTeX, Lout, ....) just emit the formatting instructions (e.g. the .tex or .lout source file) with some unique counting (perhaps simpler to do in some scripting language like Python or Ocaml).
Then run the relevant tool to get a .pdf file.

Using different program office extension

I have a program that can access a database with a whole bunch of articles.
Due to copyright, I can't access the database straight from my program, but I have a different program that can access it, and it's legitimate to copy small bits from the articles.
Because my friends and I quote a lot from these articles, I thought it would be useful if we could find an add-in for Word that will copy the requested part from an article.
Is there any add-in for Word that would let me use the program that I mentioned above so that I can access the database from within Word?
I would like to program this add-in myself, if possible.
Without further information about which operating system, and version of Word you are using, I can offer only a general outline.
1) It seems to me that you want to make a Word macro using Word Basic, or Visual Basic.
2) When you want to call your program which is external to Word, you need to use the shell command as outlined here from Microsoft's webpage.
I hope that helps you get started writing your macro!
CHEERS
Well its a wrokaround but you can use an automation tool which can run a sequence of actions on a given GUI like Winrunner or TestQuest to semulate the usage of the program, i assume these tools can get an input from a given xml or text file and log outputs in log text file.
If you have the output in a text file you will be able to parse the file using any programmign language and get the information you need and write it to eord or whatever format using OLE objects.

Synchronous viewing of several log files

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!

Resources