troubleshoot icon indicating copy to clipboard operation
troubleshoot copied to clipboard

feat: add the Regular Expression analyzer to host analyzers

Open diamonwiggins opened this issue 2 years ago • 0 comments

Describe the rationale for the suggested feature.

We have an analyzer which can be used to evaluate regular expressions over the collected contents of a support bundle, but it's only available as an in-cluster analyzer and thus not available in kind: HostPreflight which only includes host collectors and analyzers. The textAnalyze analyzer would be useful in Host Preflights for the same utility it provides in kind: Preflight and kind: SupportBundle

Describe the feature

kind: HostPreflight should be updated to include the textAnalyze analyzer:

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: http
spec:
  hostCollectors:
    - run:
        collectorName: "ping-google"
        command: "ping"
        args: ["-c", "5", "google.com"]
  hostAnalyzers:
    - textAnalyze:
        checkName: "run-ping"
        fileName: ping.txt/run-ping.log
        regexGroups: '(?P<Transmitted>\d+) packets? transmitted, (?P<Received>\d+) packets? received, (?P<Loss>\d+)(\.\d+)?% packet loss'
        outcomes:
          - pass:
              when: "Loss < 5"
              message: Solid connection to google.com
          - fail:
              message: High packet loss

Describe alternatives you've considered

Additional context

diamonwiggins avatar Jun 01 '23 16:06 diamonwiggins