@Override public void init(final ProcessContext context) { debug = context.getPropertyValue(DEBUG_PROPERTY).asBoolean(); if (debug) { logger.debug("Initializing PCap Processor"); } }
@Override public void init(final ProcessContext context) { debug = context.getPropertyValue(CONFIG_DEBUG).asBoolean(); /** * Get source of traffic service (aka Elasticsearch service) and the cache */ super.init(context); cacheService = context.getPropertyValue(CONFIG_CACHE_SERVICE).asControllerService(CacheService.class); if(cacheService == null) { logger.error("Cache service is not initialized!"); } }
logger.debug("Initializing User-Agent Processor"); debug = context.getPropertyValue(DEBUG).asBoolean(); userAgentField = context.getPropertyValue(USERAGENT_FIELD).asString(); userAgentKeep = context.getPropertyValue(USERAGENT_KEEP).asBoolean(); useCache = context.getPropertyValue(CACHE_ENABLED).asBoolean(); cacheSize = context.getPropertyValue(CACHE_SIZE).asInteger(); String tmp = context.getPropertyValue(FIELDS_TO_RETURN).asString(); selectedFields = Arrays.asList(tmp.split(",")).stream().map(String::trim).collect(Collectors.toList()); confidenceEnabled = context.getPropertyValue(CONFIDENCE_ENABLED).asBoolean(); ambiguityEnabled = context.getPropertyValue(AMBIGUITY_ENABLED).asBoolean();
@Override public void init(final ProcessContext context) { this.fieldsNameMapping = getFieldsNameMapping(context); this.nbSplitLimit = context.getPropertyValue(NB_SPLIT_LIMIT).asInteger(); this.isEnabledSplitCounter = context.getPropertyValue(ENABLE_SPLIT_COUNTER).asBoolean(); this.splitCounterSuffix = context.getPropertyValue(SPLIT_COUNTER_SUFFIX).asString(); }
protected void processIp(Record record, String ip, ProcessContext context) { debug = context.getPropertyValue(CONFIG_DEBUG).asBoolean();
hierarchical = propertyValue.asBoolean();
final String valueRegexString = context.getPropertyValue(VALUE_REGEX).asString(); final String eventType = context.getPropertyValue(RECORD_TYPE).asString(); final boolean keepRawContent = context.getPropertyValue(KEEP_RAW_CONTENT).asBoolean(); final Pattern valueRegex = Pattern.compile(valueRegexString);
private static JedisPoolConfig createJedisPoolConfig(final ControllerServiceInitializationContext context) { final JedisPoolConfig poolConfig = new JedisPoolConfig(); poolConfig.setMaxTotal(context.getPropertyValue(RedisUtils.POOL_MAX_TOTAL).asInteger()); poolConfig.setMaxIdle(context.getPropertyValue(RedisUtils.POOL_MAX_IDLE).asInteger()); poolConfig.setMinIdle(context.getPropertyValue(RedisUtils.POOL_MIN_IDLE).asInteger()); poolConfig.setBlockWhenExhausted(context.getPropertyValue(RedisUtils.POOL_BLOCK_WHEN_EXHAUSTED).asBoolean()); poolConfig.setMaxWaitMillis(context.getPropertyValue(RedisUtils.POOL_MAX_WAIT_TIME).asTimePeriod(TimeUnit.MILLISECONDS)); poolConfig.setMinEvictableIdleTimeMillis(context.getPropertyValue(RedisUtils.POOL_MIN_EVICTABLE_IDLE_TIME).asTimePeriod(TimeUnit.MILLISECONDS)); poolConfig.setTimeBetweenEvictionRunsMillis(context.getPropertyValue(RedisUtils.POOL_TIME_BETWEEN_EVICTION_RUNS).asTimePeriod(TimeUnit.MILLISECONDS)); poolConfig.setNumTestsPerEvictionRun(context.getPropertyValue(RedisUtils.POOL_NUM_TESTS_PER_EVICTION_RUN).asInteger()); poolConfig.setTestOnCreate(context.getPropertyValue(RedisUtils.POOL_TEST_ON_CREATE).asBoolean()); poolConfig.setTestOnBorrow(context.getPropertyValue(RedisUtils.POOL_TEST_ON_BORROW).asBoolean()); poolConfig.setTestOnReturn(context.getPropertyValue(RedisUtils.POOL_TEST_ON_RETURN).asBoolean()); poolConfig.setTestWhileIdle(context.getPropertyValue(RedisUtils.POOL_TEST_WHILE_IDLE).asBoolean()); return poolConfig; }
final boolean enrichRecord = context.getPropertyValue(ENRICH_RECORD).asBoolean(); if (debug)
boolean addRootRecord = context.getPropertyValue(KEEP_ROOT_RECORD).asBoolean(); boolean includePosition = context.getPropertyValue(INCLUDE_POSITION).asBoolean(); List<String> concatFields = context.getPropertyValue(CONCAT_FIELDS).isSet() ? Arrays.asList(context.getPropertyValue(CONCAT_FIELDS).asString().split(",")) : Collections.emptyList(); String concatSeparator = context.getPropertyValue(CONCAT_SEPARATOR).asString(); boolean copyRootRecordFields = context.getPropertyValue(COPY_ROOT_RECORD_FIELDS).asBoolean(); List<Record> outputRecords = new ArrayList<>();
SolrClient client; final Boolean isCloud = context.getPropertyValue(SOLR_CLOUD).asBoolean(); final String connectionString = context.getPropertyValue(SOLR_CONNECTION_STRING).asString(); final String collection = context.getPropertyValue(SOLR_COLLECTION).asString();
protected void processIp(Record record, String ip, ProcessContext context) { overwrite = context.getPropertyValue(CONFIG_OVERWRITE_FQDN).asBoolean(); cacheValidityPeriodSec = (long)context.getPropertyValue(CONFIG_CACHE_MAX_TIME).asInteger(); resolutionTimeoutMs = (long)context.getPropertyValue(CONFIG_RESOLUTION_TIMEOUT).asInteger(); debug = context.getPropertyValue(CONFIG_DEBUG).asBoolean();
if (!context.getPropertyValue(ALLOW_OVERWRITE).asBoolean()) { validationResults.add( new ValidationResult.Builder()
Boolean allowNoBrace = context.getPropertyValue(ALLOw_NO_BRACE).asBoolean(); Integer maxPreparedStatements = context.getPropertyValue(MAX_PREPARED_STATEMENTS).asInteger();
final String FLAT_SEPARATOR = "_"; final String referer_field = context.getPropertyValue(REFERER_FIELD).asString(); final boolean hierarchical = context.getPropertyValue(HIERARCHICAL).asBoolean();
/** * Instantiate Chronix Client. This should be called by subclasses' @OnScheduled method to create a client * if one does not yet exist. If called when scheduled, closeClient() should be called by the subclasses' @OnStopped * method so the client will be destroyed when the processor is stopped. * * @param context The context for this processor * @throws ProcessException if an error occurs while creating an Chronix client */ protected void createSolrClient(ControllerServiceInitializationContext context) throws ProcessException { if (solr != null) { return; } // create a solr client final boolean isCloud = context.getPropertyValue(SOLR_CLOUD).asBoolean(); final String connectionString = context.getPropertyValue(SOLR_CONNECTION_STRING).asString(); final String collection = context.getPropertyValue(SOLR_COLLECTION).asString(); if (isCloud) { //logInfo("creating solrCloudClient on $solrUrl for collection $collection"); CloudSolrClient cloudSolrClient = new CloudSolrClient.Builder().withZkHost(connectionString).build(); cloudSolrClient.setDefaultCollection(collection); cloudSolrClient.setZkClientTimeout(30000); cloudSolrClient.setZkConnectTimeout(30000); solr = cloudSolrClient; } else { // logInfo(s"creating HttpSolrClient on $solrUrl for collection $collection") solr = new HttpSolrClient.Builder(connectionString + "/" + collection).build(); } }