3.3. Basic Use Cases¶
This chapter describes six common Retrospective use cases, each as a numbered walkthrough of the steps you take in the program. They cover ad-hoc monitoring, contextual search, profile based search of files and of containers, ad-hoc container monitoring and Windows event log search. You can rearrange and combine the steps in many ways at any moment.
3.3.1. Ad-Hoc Monitoring with Highlighting¶
Software developers run their programs from within their integrated development environment (IDE). During development, programs write log data to a file on the local file system. That log data reports the processed data and the internal processing. Retrospective lets you monitor such log files and presents new data in real time.
Fig. 3.4 Ad-hoc monitoring with highlighting, step by step.¶
Open a new search tab and press the
Choose new files button above the profile selection
drop-down list. In the Add Data Source(s) dialog, select the
file you want to monitor and press the OK button. Check the
state of the Autofind configuration checkbox left of the
OK button. If it is selected, Retrospective automatically
analyzes the selected log file to determine its encoding, the
log entry separation (delimiter) and the date/time
format.The chosen file now appears in the profile selection drop-down list. Press the
Configure current data
source(s) button above it to open the Configure Data
Source(s) dialog, where you configure the choice further. There you
define or correct the file encoding, the log entry separation
(delimiter), the date/time format and
custom columns by hand. You can also add further
files, folders (with a filter), containers and Event Logs.Once the data source(s) have been correctly defined, switch to monitor mode: click the arrow on the right of the
Start Search button and choose
Monitor. Then click
Start Monitor (see Starting a Search or Monitor).Every time a new log entry is written to one of the chosen files, it immediately appears in the result table inside Retrospective.
Individual log entry rows have a background color representing their log level, for example red for ERROR. The color marks critical issues as soon as they appear. You can change this default behavior at any time by selecting a predefined highlighting set or by defining your own rules, colors and fonts.
If you want to see details of a multi-line log entry, select the related row in the result table.
3.3.2. Contextual Search¶
Software testers use program log data to describe the cause of a program failure in detail. That description tells the software developers who have to fix the problem what happened. Testers often first try to find an error log entry that correlates with the particular program failure. From there, they fetch all log data that was generated during a specified time span. They then attach the fetched log data to the relevant issue in the company bug tracking system.
Fig. 3.5 Contextual search, step by step.¶
Open the File Browser () and navigate to the relevant directory to which the program under test writes its log data. Choose the log file you are interested in. Right-click the file and choose Start searching in the context menu. To choose several log files, select the check box in front of each file’s name. To choose all files from the selected directory, open
Choose file selection mode
on the file table toolbar and choose
Select items using filter. To limit the list of available
files, enter a text pattern in the file filter field, for example
*.log. Then press the
Create new
tab for searching in selected data source(s) button, located top
right. It opens a new search tab for the selected files; it does not
start the search.Optionally, add log files from another directory or host: click
Configure current data source(s)
and add them with
Add file(s) in the
Configure Data Source(s) dialog. Clicking the browser button
again opens another tab without the files chosen before.On the search tab, enter a text pattern that finds the log data you are interested in. To combine several search criteria, add other text search criteria with the
Add text
search criterion button and join them with Match all (AND)
or Match any (OR) (see Defining Search Criteria).Once all your search criteria are defined, press the
Start Search button.Retrospective displays individual log entries that match your search criteria as soon as it finds them. In the result table, log entries of level (severity) ERROR and WARNING have a red and an amber background color. These colors mark the important issues.
If you want to examine one log entry more closely, right-click it. In the context menu, select the menu item . Retrospective creates a new search tab that holds only this time criterion. Press its
Start Search button to run the contextual
search.Retrospective now presents the log data from the same file, starting one minute before the selected log entry.
3.3.3. Profile Based File Search with Filtering and Sorting¶
Operations support team members scan well-defined sets of log files on different servers to find problems early. An enterprise application is built of many programs, and each of them reports problems in its log data. You can filter and sort the fetched log data locally, and remove uninteresting data from the result set. The final result set holds condensed information about production issues. Save it to a file and share it with colleagues as input for further investigations.
Fig. 3.6 Profile based file search with filtering and sorting, step by step.¶
Create a profile within the Profile Manager () and add as many file data sources as appropriate (see Profiles). Data sources can be individual files on the local computer or on different remote servers. Data sources may also be entire directories or a group of files whose names match a user-defined text pattern.
Open a new search tab with
Open new Search
Tab. It selects the profile highlighted in the Profile Manager. On a
tab that is already open, select the profile in the profile drop-down
list.On the search tab, press the
Add
time search criterion button and choose the desired date/time search
criteria. Now enter the text search criteria. If required, add other
search criteria with the
Add text
search criterion button and join them with Match all (AND)
or Match any (OR). You could, for example, add a text
pattern that finds the log data of your interest written during a
specified time period (see Defining Search Criteria).Once all your search criteria are defined, press the
Start Search button.Retrospective displays individual log entries that match your search criteria as soon as it finds them. In the result table, use the local sort and filter options to rearrange the result set and find the data of immediate interest. A local filter limits the number of result entries, so you do not have to run the search once again with redefined search criteria. You can also reduce the number of result entries by repeatedly selecting and deleting groups of irrelevant log entries from the result table (see Result Table Toolbar).
Choose and then Text file, one of the five save formats (HTML, Text, CSV, Excel and JSON). Retrospective saves the arranged set of log data to a text file for further analysis.
3.3.4. Profile Based Container Search with Formatting¶
Fig. 3.7 Profile based container search with formatting, step by step.¶
Create a profile within the Profile Manager () and add as many Docker or Kubernetes container data sources as appropriate (see Profiles). Data sources may also be entire directories (Images, Pods and so on) or a group of containers whose names match a user-defined text pattern.
Open a new search tab with
Open new Search
Tab. It selects the profile highlighted in the Profile Manager. On a
tab that is already open, select the profile in the profile drop-down
list.On the search tab, press the
Add
time search criterion button and choose the desired date/time search
criteria. Now enter the text search criteria. If required, add other
search criteria with the
Add text
search criterion button and join them with Match all (AND)
or Match any (OR). You could, for example, add a text
pattern that finds the log data of your interest written during a
specified time period (see Defining Search Criteria).Once all your search criteria are defined, press the
Start Search button.Retrospective displays individual log entries that match your search criteria as soon as it finds them. Select a row to see its content in the result detail pane underneath the result table. Click the arrow of the Select formatting button on the detail toolbar and choose
JSON or
XML, depending on the expected log entry content
(None turns formatting off). Retrospective then formats
such structures; pretty printing and syntax highlighting are separate
toggles, both on by default (see Result Details Pane).Choose and then Excel file. Retrospective saves the log data to an Excel workbook, and keeps the formatting and the syntax highlighting there if you want them.
3.3.5. Ad-Hoc Container Monitoring with Custom Columns¶
Fig. 3.8 Ad-hoc container monitoring with custom columns, step by step.¶
Create a profile within the Profile Manager () and add as many Docker or Kubernetes container data sources as appropriate (see Profiles). Data sources may also be entire directories (Images, Pods and so on) or a group of containers whose names match a user-defined text pattern.
Press the
Add field to new custom
column button located at the top of the right-hand section of the
Profile Manager. This displays the Add Field dialog, which
presents different groups of items to choose from. The group
Detected in Data presents all ready-to-use name/value
pattern fields detected in data samples retrieved from
the selected containers (see Custom Columns).Optionally define additional custom columns for expected fields. Retrospective extracts these fields with regular expressions that you can edit freely. The Add Field dialog assists you by proposing well known patterns such as name/value pairs, date/time, currency and so on.
Open a new search tab with
Open new Search
Tab. It selects the profile highlighted in the Profile Manager. On a
tab that is already open, select the profile in the profile drop-down
list.Once the data source(s) have been correctly defined, switch to monitor mode: click the arrow on the right of the
Start Search button and choose Monitor. Then
click
Start Monitor (see
Starting a Search or Monitor).Retrospective extracts the user-defined fields and displays them in the appropriate custom columns. It can also detect new name/value pattern fields while monitoring continues. Custom columns are locked while the profile is used by a running search or monitoring: to add more, click Stop Monitor first, then create additional custom columns in the Profile Manager.
Press the
Start Monitor button again and
observe how Retrospective extracts the user-defined fields and displays
them in the appropriate custom columns. Use sorting and filtering on
standard and custom columns and analyze your log data.
3.3.6. Windows Event Log Search¶
System administrators check the Windows event logs of their servers for errors and security events. Retrospective searches them on the host and returns only the matching events.
Fig. 3.9 Windows event log search, step by step.¶
Click
Choose new Event Logs, choose
a host and select the event logs or providers. If Autofind
configuration is selected (the default), the tab runs Autofind. It does
not start the search.Optionally, add event logs from another host: click
Configure current data source(s)
and add them with
Add Event Log(s) in
the Configure Data Source(s) dialog. Choosing new event logs
again switches the tab to a new profile with only those.Click
Add event-log filter, set Event ID,
Levels or Keywords, and click
Accept.Click Start Search.
The matching events appear in the result table.