Ejemplo n.º 1
0
        public PrintCommand(SeqCliOutputConfig outputConfig)
        {
            if (outputConfig == null)
            {
                throw new ArgumentNullException(nameof(outputConfig));
            }
            _noColor    = outputConfig.DisableColor;
            _forceColor = outputConfig.ForceColor;

            _fileInputFeature = Enable(new FileInputFeature("CLEF file to read", supportsWildcard: true));

            Options.Add("f=|filter=",
                        "Filter expression to select a subset of events",
                        v => _filter = ArgumentString.Normalize(v));

            Options.Add("template=",
                        "Specify an output template to control plain text formatting",
                        v => _template = ArgumentString.Normalize(v));

            _invalidDataHandlingFeature = Enable <InvalidDataHandlingFeature>();

            Options.Add("no-color", "Don't colorize text output", v => _noColor = true);

            Options.Add("force-color",
                        "Force redirected output to have ANSI color (unless `--no-color` is also specified)",
                        v => _forceColor = true);
        }
Ejemplo n.º 2
0
        public IngestCommand(SeqConnectionFactory connectionFactory)
        {
            _connectionFactory          = connectionFactory;
            _fileInputFeature           = Enable(new FileInputFeature("File(s) to ingest", supportsWildcard: true));
            _invalidDataHandlingFeature = Enable <InvalidDataHandlingFeature>();
            _properties = Enable <PropertiesFeature>();

            Options.Add("x=|extract=",
                        "An extraction pattern to apply to plain-text logs (ignored when `--json` is specified)",
                        v => _pattern = string.IsNullOrWhiteSpace(v) ? DefaultPattern : v.Trim());

            Options.Add("json",
                        "Read the events as JSON (the default assumes plain text)",
                        v => _json = true);

            Options.Add("f=|filter=",
                        "Filter expression to select a subset of events",
                        v => _filter = string.IsNullOrWhiteSpace(v) ? null : v.Trim());

            Options.Add(
                "m=|message=",
                "A message to associate with the ingested events; https://messagetemplates.org syntax is supported",
                v => _message = string.IsNullOrWhiteSpace(v) ? null : v.Trim());

            Options.Add("l=|level=",
                        "The level or severity to associate with the ingested events; this will override any " +
                        "level information present in the events themselves",
                        v => _level = string.IsNullOrWhiteSpace(v) ? null : v.Trim());

            _sendFailureHandlingFeature = Enable <SendFailureHandlingFeature>();
            _connection = Enable <ConnectionFeature>();
            _batchSize  = Enable <BatchSizeFeature>();
        }
Ejemplo n.º 3
0
 public ImportCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
     _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));
     _fileInputFeature  = Enable(new FileInputFeature("File to import"));
     _connection        = Enable <ConnectionFeature>();
 }
Ejemplo n.º 4
0
 public PipeCommand()
 {
     _fileInputFeature      = Enable <FileInputFeature>();
     _fileOutputFeature     = Enable <FileOutputFeature>();
     _enrichFeature         = Enable <EnrichFeature>();
     _filterFeature         = Enable <FilterFeature>();
     _jsonFormatFeature     = Enable <JsonFormatFeature>();
     _templateFormatFeature = Enable <TemplateFormatFeature>();
     _seqOutputFeature      = Enable <SeqOutputFeature>();
 }
Ejemplo n.º 5
0
        public IngestCommand(SeqConnectionFactory connectionFactory)
        {
            _connectionFactory          = connectionFactory;
            _fileInputFeature           = Enable <FileInputFeature>();
            _invalidDataHandlingFeature = Enable <InvalidDataHandlingFeature>();
            _properties = Enable <PropertiesFeature>();

            Options.Add("f=|filter=",
                        "Filter expression to select a subset of events",
                        v => _filter = string.IsNullOrWhiteSpace(v) ? null : v.Trim());

            _connection = Enable <ConnectionFeature>();
        }
Ejemplo n.º 6
0
        public ImportCommand(SeqConnectionFactory connectionFactory, SeqCliConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            Options.Add(
                "merge",
                "Update signals that have ids matching those in the imported data; the default is to always create new signals",
                _ => _merge = true);

            _fileInputFeature = Enable(new FileInputFeature("File to import"));
            _entityOwner      = Enable(new EntityOwnerFeature("signal", "import"));
            _connection       = Enable <ConnectionFeature>();
        }
Ejemplo n.º 7
0
        public IngestCommand(SeqConnectionFactory connectionFactory)
        {
            _connectionFactory          = connectionFactory;
            _fileInputFeature           = Enable <FileInputFeature>();
            _invalidDataHandlingFeature = Enable <InvalidDataHandlingFeature>();
            _properties = Enable <PropertiesFeature>();

            Options.Add("x=|extract=",
                        "An extraction pattern to apply to plain-text logs (ignored when `--json` is specified)",
                        v => _pattern = string.IsNullOrWhiteSpace(v) ? DefaultPattern : v.Trim());

            Options.Add("json",
                        "Read the events as JSON (the default assumes plain text)",
                        v => _json = true);

            Options.Add("f=|filter=",
                        "Filter expression to select a subset of events",
                        v => _filter = string.IsNullOrWhiteSpace(v) ? null : v.Trim());

            _sendFailureHandlingFeature = Enable <SendFailureHandlingFeature>();
            _connection = Enable <ConnectionFeature>();
        }