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.

Six steps from selecting a log file to examining log details

Fig. 3.4 Ad-hoc monitoring with highlighting, step by step.

  1. Open a new search tab and press the i-choose-new-files 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.

  2. The chosen file now appears in the profile selection drop-down list. Press the i-configure-data-sources 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.

  3. Once the data source(s) have been correctly defined, switch to monitor mode: click the arrow on the right of the i-start-search Start Search button and choose Monitor. Then click i-start-monitor Start Monitor (see Starting a Search or Monitor).

  4. Every time a new log entry is written to one of the chosen files, it immediately appears in the result table inside Retrospective.

  5. 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.

  6. If you want to see details of a multi-line log entry, select the related row in the result table.

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.

Six steps from creating a profile to saving the results

Fig. 3.6 Profile based file search with filtering and sorting, step by step.

  1. Create a profile within the Profile Manager (View ‣ Open 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.

  2. Open a new search tab with i-new-search 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.

  3. On the search tab, press the i-add-datetime-criteria 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 i-add-text-criteria 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).

  4. Once all your search criteria are defined, press the i-start-search Start Search button.

  5. 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).

  6. Choose Result Data ‣ Save to 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

Six steps from creating a container profile to saving results to Excel or CSV

Fig. 3.7 Profile based container search with formatting, step by step.

  1. Create a profile within the Profile Manager (View ‣ Open 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.

  2. Open a new search tab with i-new-search 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.

  3. On the search tab, press the i-add-datetime-criteria 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 i-add-text-criteria 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).

  4. Once all your search criteria are defined, press the i-start-search Start Search button.

  5. 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 i-format-json JSON or i-format-xml 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).

  6. Choose Result Data ‣ Save to 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

Seven steps from creating a container profile to monitoring with custom columns

Fig. 3.8 Ad-hoc container monitoring with custom columns, step by step.

  1. Create a profile within the Profile Manager (View ‣ Open 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.

  2. Press the i-add-field-to-new-column 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).

  3. 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.

  4. Open a new search tab with i-new-search 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.

  5. Once the data source(s) have been correctly defined, switch to monitor mode: click the arrow on the right of the i-start-search Start Search button and choose Monitor. Then click i-start-monitor Start Monitor (see Starting a Search or Monitor).

  6. 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.

  7. Press the i-start-monitor 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.