<commit_before>
input_logs:                                       # List of input logs
  - path: .                                       # Where to look for log files
    recursive: yes                                # Whether to descend into subdirectories recursively
    pattern: (Node\d+)\.log                       # Log file regex pattern to look for
    node_group: 1                                 # Group number that matches node identifier
    only_timestamped: yes                         # Whether to discard non-timestamped lines


chains:                                           # List of processing chains
  main:                                           # Main processing chain
  - match or drop: [view_change_event]            # Drop everything except view change messages
  - log line: view_change                         # Save message to view_change log sink
  - log_view_change_start:                        # Call chain log_view_change_start
  - log_view_change_done:                         # Call chain log_view_change_done

  log_view_change_start:
  - match: [view_change_start]                    # Return unless message is view change start
  - log line: view_change_start_done              # Save message to view_change_start_done log sink
  - log time: {view_change: start}                # Add message to view_change-start timelog sink
  - drop:                                         # Drop message, since we'll no longer need it

  log_view_change_done:
  - match: [view_change_done]                     # Return unless message is view change done
  - log line: view_change_start_done              # Save message to view_change_start_done log sink
  - log time: {view_change: done}                 # Add message to view_change-done timelog sink
  - drop:                                         # Drop message, since we'll no longer need it

outputs:<commit_msg>Log processor: improved view change example<commit_after>
input_logs:                                       # List of input logs
  - path: .                                       # Where to look for log files
    recursive: yes                                # Whether to descend into subdirectories recursively
    pattern: (Node\d+)\.log                       # Log file regex pattern to look for
    node_group: 1                                 # Group number that matches node identifier
    only_timestamped: yes                         # Whether to discard non-timestamped lines


chains:                                           # List of processing chains
  main:                                           # Main processing chain
  - match all or drop:                            # Drop unless message...
    - replica: master                             # ...is from node or master replica...
    - view_change_event:                          # ...and is related to view change
  - log line: view_change                         # Save message to view_change log sink
  - log_view_change_start:                        # Call chain log_view_change_start
  - log_view_change_done:                         # Call chain log_view_change_done

  log_view_change_start:
  - match: [view_change_start]                    # Return unless message is view change start
  - log line: view_change_start_done              # Save message to view_change_start_done log sink
  - log time: {view_change: start}                # Add message to view_change-start timelog sink
  - drop:                                         # Drop message, since we'll no longer need it

  log_view_change_done:
  - match: [view_change_done]                     # Return unless message is view change done
  - log line: view_change_start_done              # Save message to view_change_start_done log sink
  - log time: {view_change: done}                 # Add message to view_change-done timelog sink
  - drop:                                         # Drop message, since we'll no longer need it

outputs:
{'fraction_non_alphanumeric': 0.046949535525985436, 'fraction_numerical': 0.0005021340697966357, 'mean_word_length': 1.3504424778761062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '123865', 'n_tokens_mistral': 908, 'n_tokens_neox': 867, 'n_words': 332}