Beispiel #1
0
        public RenderCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "i=|id=",
                "The id of a single dashboard to render",
                t => _id = ArgumentString.Normalize(t));
            Options.Add("c=|chart=", "The title of a chart on the dashboard to render",
                        c => _chartTitle = ArgumentString.Normalize(c));
            Options.Add("last=",
                        "A duration over which the chart should be rendered, e.g. `7d`; this will be aligned to an interval boundary; either `--last` or `--start` and `--end` must be specified",
                        v => _lastDuration = ArgumentString.Normalize(v));
            Options.Add("by=",
                        "The time-slice interval for the chart data, as a duration, e.g. `1h`",
                        v => _intervalDuration = ArgumentString.Normalize(v));
            _range      = Enable <DateRangeFeature>();
            _signal     = Enable <SignalExpressionFeature>();
            _timeout    = Enable <TimeoutFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
            _connection = Enable <ConnectionFeature>();
        }
Beispiel #2
0
        public TailCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "f=|filter=",
                "An optional server-side filter to apply to the stream, for example `@Level = 'Error'`",
                v => _filter = v);

            _output     = Enable(new OutputFormatFeature(config.Output));
            _signal     = Enable <SignalExpressionFeature>();
            _connection = Enable <ConnectionFeature>();
        }
Beispiel #3
0
 public QueryCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
     _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
     Options.Add("q=|query=", "The query to execute", v => _query = v);
     _range  = Enable <DateRangeFeature>();
     _signal = Enable <SignalExpressionFeature>();
     Options.Add("timeout=", "The query execution timeout in milliseconds", v => _timeoutMS = int.Parse(v?.Trim() ?? "0"));
     _output     = Enable(new OutputFormatFeature(config.Output));
     _connection = Enable <ConnectionFeature>();
 }
Beispiel #4
0
        public SearchCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "f=|filter=",
                "A filter to apply to the search, for example `Host = 'xmpweb-01.example.com'`",
                v => _filter = v);
            Options.Add(
                "c=|count=",
                $"The maximum number of events to retrieve; the default is {_count}",
                v => _count = int.Parse(v, CultureInfo.InvariantCulture));

            _range      = Enable <DateRangeFeature>();
            _output     = Enable(new OutputFormatFeature(config.Output));
            _signal     = Enable <SignalExpressionFeature>();
            _connection = Enable <ConnectionFeature>();
        }