Configure extends Thread { protected void applyTelegrafInputConfig() { Map<String, ScouterTgMtConfig> tConfigMap = new HashMap<String, ScouterTgMtConfig>(); for (Map.Entry<Object, Object> e : property.entrySet()) { String key = (String) e.getKey(); String value = (String) e.getValue(); if(value == null) { continue; } if (key.startsWith(TELEGRAF_INPUT_MEASUREMENT_PREFIX)) { String simplifiedKey = key.substring(TELEGRAF_INPUT_MEASUREMENT_PREFIX_LENGTH); int secondDollar = simplifiedKey.indexOf("$_"); String measurement = simplifiedKey.substring(0, secondDollar); String postfix = simplifiedKey.substring(secondDollar + 1); ScouterTgMtConfig tConfig = tConfigMap.get(measurement); if (tConfig == null) { tConfig = new ScouterTgMtConfig(measurement); tConfig.setObjTypePrependTags(Arrays.asList(input_telegraf_$measurement$_objType_prepend_tags)); tConfigMap.put(measurement, tConfig); } if (TELEGRAF_INPUT_MEASUREMENT_ENABLED_POSTFIX.equals(postfix)) { try { tConfig.setEnabled(Boolean.parseBoolean(value)); } catch (Exception ignored) {} } else if (TELEGRAF_INPUT_MEASUREMENT_DEBUG_ENABLED_POSTFIX.equals(postfix)) { try { tConfig.setDebugEnabled(Boolean.parseBoolean(value)); } catch (Exception ignored) {} } else if (TELEGRAF_INPUT_MEASUREMENT_TAG_FILTER_POSTFIX.equals(postfix)) { String[] mappings = StringUtil.split(value, ','); if (mappings.length == 0) { continue; } Map<String, List<String>> tagFilterMap = new HashMap<String, List<String>>(); for (String mapping : mappings) { String[] kv = StringUtil.split(mapping, ':'); if (kv.length != 2) { Logger.println("CFG003", "Abnormal line protocol tag mapping config."); continue; } List list = tagFilterMap.get(kv[0]); if (list == null) { list = new ArrayList(); tagFilterMap.put(kv[0], list); } list.add(kv[1]); } tConfig.setTagFilter(tagFilterMap); } else if (TELEGRAF_INPUT_MEASUREMENT_COUNTER_MAPPINGS_POSTFIX.equals(postfix)) { String[] counterMappings = StringUtil.split(value, ','); if (counterMappings == null || counterMappings.length == 0) { continue; } Map<String, CounterProtocol> counterMappingMap = new HashMap<String, CounterProtocol>(); for (String counterMapping : counterMappings) { CounterProtocol counter = new CounterProtocol(); String[] split = StringUtil.splitByWholeSeparatorPreserveAllTokens(counterMapping, ':'); if (split.length >= 2) { String originName = split[0]; String originName0 = originName; if (originName.charAt(0) == '&') { if (originName.charAt(1) == '&') { counter.setDeltaType(DeltaType.BOTH); originName0 = originName.substring(2); } else { counter.setDeltaType(DeltaType.DELTA); originName0 = originName.substring(1); } } counterMappingMap.put(originName0, counter); counter.setName(split[1]); } if (split.length >= 3) { if (StringUtil.isNotEmpty(split[2])) { counter.setDisplayName(split[2]); } else { counter.setDisplayName(split[1]); } } else { counter.setDisplayName(split[1]); } if (split.length >= 4) { counter.setUnit(split[3]); } else { counter.setUnit(""); } if (split.length >= 5) { try { counter.setTotal(Boolean.parseBoolean(split[4])); } catch (Exception ignored) {} } if (split.length >= 6) { int normalizeSec = 0; try { normalizeSec = Integer.valueOf(split[5]); } catch (Exception ignored) {} counter.setNormalizeSec(normalizeSec); } } tConfig.setCounterMapping(counterMappingMap); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_FAMILY_BASE_POSTFIX.equals(postfix)) { tConfig.setObjFamilyBase(value); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_FAMILY_APPEND_TAGS_POSTFIX.equals(postfix)) { String[] tags = StringUtil.split(value, ','); if (tags == null || tags.length == 0) { continue; } tConfig.setObjFamilyAppendTags(Arrays.asList(tags)); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_TYPE_BASE_POSTFIX.equals(postfix)) { tConfig.setObjTypeBase(value); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_TYPE_PREPEND_TAGS_POSTFIX.equals(postfix)) { if (StringUtil.isEmpty(value)) { value = input_telegraf_$measurement$_objType_prepend_tags; } String[] tags = StringUtil.split(value, ','); if (tags == null || tags.length == 0) { continue; } tConfig.setObjTypePrependTags(Arrays.asList(tags)); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_TYPE_APPEND_TAGS_POSTFIX.equals(postfix)) { String[] tags = StringUtil.split(value, ','); if (tags == null || tags.length == 0) { continue; } tConfig.setObjTypeAppendTags(Arrays.asList(tags)); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_TYPE_ICON_POSTFIX.equals(postfix)) { tConfig.setObjTypeIcon(value); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_NAME_BASE_POSTFIX.equals(postfix)) { tConfig.setObjNameBase(value); } else if (TELEGRAF_INPUT_MEASUREMENT_OBJ_NAME_APPEND_TAGS.equals(postfix)) { String[] tags = StringUtil.split(value, ','); if (tags == null || tags.length == 0) { continue; } tConfig.setObjNameAppendTags(Arrays.asList(tags)); } else if (TELEGRAF_INPUT_MEASUREMENT_HOST_TAG_POSTFIX.equals(postfix)) { tConfig.setHostTag(value); } else if (TELEGRAF_INPUT_MEASUREMENT_HOST_MAPPINGS_POSTFIX.equals(postfix)) { String[] hostMappings = StringUtil.split(value, ','); if (hostMappings == null || hostMappings.length == 0) { continue; } Map<String, String> hostMappingMap = new HashMap<String, String>(); for (String hostAndMap : hostMappings) { String[] split = StringUtil.split(hostAndMap, ':'); if (split.length == 2) { hostMappingMap.put(split[0], split[1]); } } tConfig.setHostMapping(hostMappingMap); } } } telegrafInputConfigMapDeprecated = tConfigMap; } private  Configure(); private  Configure(boolean b); final static synchronized Configure getInstance(); final static synchronized Configure newInstanceForTestCase(); void run(); File getPropertyFile(); File getTgFile(); synchronized void reload(boolean force); String getTgConfigContents(); boolean saveTgConfigContents(String text); String getValue(String key); String getValue(String key, String def); int getInt(String key, int def); long getLong(String key, long def); boolean getBoolean(String key, boolean def); String loadText(); boolean saveText(String text); MapValue getKeyValueInfo(); StringKeyLinkedMap<String> getConfigureDesc(); StringKeyLinkedMap<ValueType> getConfigureValueType(); StringKeyLinkedMap<ValueTypeDesc> getConfigureValueTypeDesc(); static StringLinkedSet toOrderSet(String values, String deli); static void main(String[] args); final static String CONF_DIR; public Map<String, ScouterTgMtConfig> telegrafInputConfigMap; @Deprecated
	public Map<String, ScouterTgMtConfig> telegrafInputConfigMapDeprecated; public TgConfig telegrafOriginalConfig; @ConfigDesc("Server ID")
	public String server_id; public int log_test_rate; @ConfigDesc("Logging TCP connection related event")
	public boolean log_tcp_action_enabled; @ConfigDesc("Logging incoming MultiPacket")
	public boolean log_udp_multipacket; @ConfigDesc("Logging expired MultiPacket")
	public boolean log_expired_multipacket; @ConfigDesc("Logging all incoming packs")
	public boolean log_udp_packet; @ConfigDesc("Logging incoming CounterPack")
	public boolean log_udp_counter; @ConfigDesc("Logging incoming PerfInteractionCounterPack")
	public boolean log_udp_interaction_counter; @ConfigDesc("Logging incoming XLogPack")
	public boolean log_udp_xlog; @ConfigDesc("Logging incoming ProfilePack")
	public boolean log_udp_profile; @ConfigDesc("Logging incoming TextPack")
	public boolean log_udp_text; @ConfigDesc("Logging incoming AlertPack")
	public boolean log_udp_alert; @ConfigDesc("Logging incoming ObjectPack")
	public boolean log_udp_object; @ConfigDesc("Logging incoming StatusPack")
	public boolean log_udp_status; @ConfigDesc("Logging incoming StackPack")
	public boolean log_udp_stack; @ConfigDesc("Logging incoming SummaryPack")
	public boolean log_udp_summary; @ConfigDesc("Logging incoming BatchPack")
	public boolean log_udp_batch; @ConfigDesc("Logging all request handlers in starting")	
	public boolean log_service_handler_list; @ConfigDesc("Logging incoming SpanPack")
	public boolean log_udp_span; @ConfigDesc("Logging when index traversal is too heavy.")
	public int log_index_traversal_warning_count; @ConfigDesc("Retaining log according to date")
	public boolean log_rotation_enabled; @ConfigDesc("Keeping period of log")
	public int log_keep_days; @ConfigDesc("Logging sql failed to parse")
	public boolean log_sql_parsing_fail_enabled; @ConfigDesc("")
	public boolean _trace; @ConfigDesc("UDP Host")
	public String net_udp_listen_ip; @ConfigDesc("UDP Port")
	public int net_udp_listen_port; @ConfigDesc("TCP Host")
	public String net_tcp_listen_ip; @ConfigDesc("TCP Port")
	public int net_tcp_listen_port; @ConfigDesc("Client Socket Timeout(ms)")
	public int net_tcp_client_so_timeout_ms; @ConfigDesc("Agent Socket Timeout(ms)")
	public int net_tcp_agent_so_timeout_ms; @ConfigDesc("Transfer period(ms) of KEEP_ALIVE")
	public int net_tcp_agent_keepalive_interval_ms; @ConfigDesc("Waiting time(ms) for agent session")
	public int net_tcp_get_agent_connection_wait_ms; @ConfigDesc("UDP Packet Buffer Size")
	public int net_udp_packet_buffer_size; @ConfigDesc("UDP Receiver Buffer Size")
	public int net_udp_so_rcvbuf_size; @ConfigDesc("")
	public int _net_udp_worker_thread_count; @ConfigDesc("TCP Thread Pool Size")
	public int net_tcp_service_pool_size; @ConfigDesc("Activating Http Server")
	public boolean net_http_server_enabled; @ConfigDesc("Http Port")
	public int net_http_port; @ConfigDesc("user extension web root")
	public String net_http_extweb_dir; @ConfigDesc("Activating Scouter API")
	public boolean net_http_api_enabled; @ConfigDesc("Enable a swagger for HTTP API.")
	public boolean net_http_api_swagger_enabled; @ConfigDesc("Swagger option of host's ip or domain to call APIs.")
	public String net_http_api_swagger_host_ip; @ConfigDesc("API CORS support for Access-Control-Allow-Origin")
	public String net_http_api_cors_allow_origin; @ConfigDesc("Access-Control-Allow-Credentials")
	public String net_http_api_cors_allow_credentials; @ConfigDesc("size of webapp connection pool to collector")
	public int net_webapp_tcp_client_pool_size; @ConfigDesc("timeout of web app connection pool to collector")
	public int net_webapp_tcp_client_pool_timeout; @ConfigDesc("So timeout of web app to collector")
	public int net_webapp_tcp_client_so_timeout; @ConfigDesc("Enable api access control by client ip")
	public boolean net_http_api_auth_ip_enabled; @ConfigDesc("If get api caller's ip from http header.")
	public String net_http_api_auth_ip_header_key; @ConfigDesc("Enable api access control by JSESSIONID of Cookie")
	public boolean net_http_api_auth_session_enabled; @ConfigDesc("api http session timeout")
	public int net_http_api_session_timeout; @ConfigDesc("Enable api access control by Bearer token(of Authorization http header) - get access token from /user/loginGetToken.")
	public boolean net_http_api_auth_bearer_token_enabled; @ConfigDesc("Enable gzip response on api call")
	public boolean net_http_api_gzip_enabled; @ConfigDesc("api access allow ip addresses")
	@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
	public String net_http_api_allow_ips; public Set<String> allowIpExact; public List<StrMatch> allowIpMatch; @ConfigDesc("Store directory of database")
	public String db_dir; @ConfigDesc("Path to log directory")
	public String log_dir; @ConfigDesc("Path to plugin directory")
	public String plugin_dir; @ConfigDesc("Path to client related directory")
	public String client_dir; @ConfigDesc("temp dir")
	public String temp_dir; @ConfigDesc("Waiting time(ms) until stopped heartbeat of object is determined to be inactive")
	public int object_deadtime_ms; @ConfigDesc("inactive object warning level. default 0.(0:info, 1:warn, 2:error, 3:fatal)")
	public int object_inactive_alert_level; @ConfigDesc("Zipkin Waiting time(ms) until stopped heartbeat of object is determined to be inactive")
	public int object_zipkin_deadtime_ms; @ConfigDesc("Activating XLog data in zip file")
	public boolean compress_xlog_enabled; @ConfigDesc("Activating profile data in zip file")
	public boolean compress_profile_enabled; @ConfigDesc("")
	public int _compress_write_buffer_block_count; @ConfigDesc("")
	public int _compress_read_cache_block_count; @ConfigDesc("")
	public long _compress_read_cache_expired_ms; @ConfigDesc("")
	public int _compress_dailycount_header_cache_size; @ConfigDesc("")
	public int _compress_write_thread; @ConfigDesc("")
	public boolean _auto_5m_sampling; @ConfigDesc("Activating automatic deletion function in the database")
	public boolean mgr_purge_enabled; @ConfigDesc("Condition of disk usage for automatic deletion. if lack, delete profile data first exclude today data.")
	public int mgr_purge_disk_usage_pct; @ConfigDesc("Retaining date for automatic deletion. delete profile data first.")
	public int mgr_purge_profile_keep_days; @Deprecated
	@ConfigDesc("Deprecated : use mgr_purge_profile_keep_days")
	public int mgr_purge_keep_days; @ConfigDesc("Retaining date for automatic deletion.")
	public int mgr_purge_xlog_keep_days; @Deprecated
	@ConfigDesc("Deprecated : use mgr_purge_xlog_keep_days")
	public int mgr_purge_xlog_without_profile_keep_days; @ConfigDesc("Retaining date for automatic deletion")
	public int mgr_purge_counter_keep_days; @ConfigDesc("Retaining date for automatic deletion. realtime-counter only.")
	public int mgr_purge_realtime_counter_keep_days; @ConfigDesc("Retaining date for automatic deletion. tag-counter only.")
	public int mgr_purge_tag_counter_keep_days; @ConfigDesc("Retaining date for automatic deletion. visitor-counter only")
	public int mgr_purge_visitor_counter_keep_days; @ConfigDesc("Retaining date for automatic deletion. daily text dictionary only")
	public int mgr_purge_daily_text_days; @ConfigDesc("Retaining date for automatic deletion. summary(stat) data only")
	public int mgr_purge_sum_data_days; @ConfigDesc("Ignored log ID set")
	@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
	public StringSet mgr_log_ignore_ids; @ConfigDesc("true for daily dictionary mode about service name. default value is false that means it's permanent.")
	public boolean mgr_text_db_daily_service_enabled; @ConfigDesc("true for daily dictionary mode about api name. default value is false that means it's permanent.")
	public boolean mgr_text_db_daily_api_enabled; @ConfigDesc("true for daily dictionary mode about user agent. default value is false that means it's permanent.")
	public boolean mgr_text_db_daily_ua_enabled; @ConfigDesc("change default memory size of hash index.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_default_mb; @ConfigDesc("change memory size of hash index for service text.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_service_mb; @ConfigDesc("change memory size of hash index for apicall text.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_api_mb; @ConfigDesc("change memory size of hash index for user agent text.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_ua_mb; @ConfigDesc("change memory size of hash index for login text.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_login_mb; @ConfigDesc("change memory size of hash index for desc text.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_desc_mb; @ConfigDesc("change memory size of hash index for hashed message text.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_index_hmsg_mb; @ConfigDesc("change memory size of hash index for daily text db.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_text_db_daily_index_mb; @ConfigDesc("change default memory size of key value store index.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_kv_store_index_default_mb; @ConfigDesc("change default memory size of xlog txid/gxid index.(MB)" +
			"[warn] modified this will break the database files.\nbackup old database files before change values.(restart required)")
	public int _mgr_xlog_id_index_mb; @ConfigDesc("name of 3rd party ui")
	public String ext_link_name; @ConfigDesc("outgoing link pattern for a 3rd party UI.(client restart required)\n" +
			"Context menu in any chart shows the menu 'Open with 3rd-party UI.'\n" +
			"* variable patterns : \n" +
			"   $[objHashes] : comma separated objHash values\n" +
			"   $[objType] : object type\n" +
			"   $[from] : start time in chart by millis\n" +
			"   $[to] : end time in chart by millis")
	public String ext_link_url_pattern; @ConfigDesc("Span Queue Size")
	public int span_queue_size; @ConfigDesc("XLog Writer Queue Size")
	public int xlog_queue_size; @ConfigDesc("Ignored time(ms) in retrieving XLog in real time")
	public int xlog_realtime_lower_bound_ms; @ConfigDesc("Ignored time(ms) in retrieving previous XLog")
	public int xlog_pasttime_lower_bound_ms; @ConfigDesc("Profile Writer Queue Size")
	public int profile_queue_size; @ConfigDesc("gxid keeping count in memory for XLog consequent sampling")
	public int xlog_sampling_matcher_gxid_keep_memory_count; @ConfigDesc("xlog keeping count in memory for XLog consequent sampling")
	public int xlog_sampling_matcher_xlog_keep_memory_count; @ConfigDesc("max keeping millis of xlog for XLog consequent sampling")
	public int xlog_sampling_matcher_xlog_keep_memory_millis; @ConfigDesc("profile keeping count (in one bucket, 500ms) in memory for XLog consequent sampling")
	public int xlog_sampling_matcher_profile_keep_memory_count; @ConfigDesc("max keeping seconds of profile for XLog consequent sampling")
	public int xlog_sampling_matcher_profile_keep_memory_secs; @ConfigDesc("Activating IP-based city/country extraction")
	public boolean geoip_enabled; @ConfigDesc("Path to GeoIP data file")
	public String geoip_data_city_file; @ConfigDesc("Activating table-based SQL compression")
	public boolean sql_table_parsing_enabled; @ConfigDesc("Activating TagCount function")
	public boolean tagcnt_enabled; @ConfigDesc("search xlog service option - max xlog count to search per request")
	public int req_search_xlog_max_count; @ConfigDesc("Path to telegraf config xml file")
	public String input_telegraf_config_file; @ConfigDesc("Deprecated use the telegraf config view instead. This value may be ignored.")
	public boolean input_telegraf_enabled; @ConfigDesc("Deprecated use the telegraf config view instead. This value may be ignored.")
	public boolean input_telegraf_debug_enabled; @ConfigDesc("Deprecated use the telegraf config view instead. This value may be ignored.")
	public boolean input_telegraf_delta_counter_normalize_default; @ConfigDesc("Deprecated use the telegraf config view instead. This value may be ignored.")
	public int input_telegraf_delta_counter_normalize_default_seconds; @ConfigDesc("Deprecated use the telegraf config view instead. This value may be ignored.")
	public int telegraf_object_deadtime_ms; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"Telegraf http input of the $measurement$ enabled.\n" +
			"$measurement$ is a variable to the measurement name of the line protocol.\n" +
			"eg) input_telegraf_$redis_keyspace$_enabled=true")
	public boolean input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"print telegraf line protocol of the $measurement$ to STDOUT")
	public boolean input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"If set, only the metric matching to this tag value is handled.\n" +
			"It can have multiple values. comma separator means 'or' condition. eg) cpu:cpu-total,cpu:cpu0\n" +
			"It also have not(!) condition. eg) cpu:!cpu-total")
    @ConfigValueType(value = ValueType.COMMA_COLON_SEPARATED_VALUE,
            strings = {"filtering tag name(reqiured)", "filtering tag value(reqiured)"},
            booleans = {true, true}
    )
	public String input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"which fields of $measurement$ are mapped to scouter's counter.\n" +
			"format: {line-protocol field name}:{scouter counter name}:{display name?}:{unit?}:{hasTotal?}:{normalize sec?}\n" +
			"It can have multiple values.\n" +
			" - {scouter counter name} can be defined in combination with the line protocol's tag variables.\n" +
			"For example, if the value of 'tag1' is 'disk01' and the value of 'tag2' is 'bin', the counter name defined as 'scouter-du-$tag1$-$tag2$' is 'scouter-du-disk01-bin'.\n" +
			" eg)used_memory:tg-redis-used-memory,used_memory_rss:redis-used-memory-rss,redis used rss,bytes:true\n" +
			" eg)cpu:cpu-$cpu-no$ -- this example shows counter definition with tag value.\n" +
			"If {line-protocol field name} is started with '&' or '&&', then It works as delta counter\n" +
			"When specified as a delta type, the difference in values per second is stored. and the counter name ends with '_delta'\n" +
			"double '&&' means BOTH type. AS BOTH type, the value and the difference value both are stored.\n" +
			" - {normalize sec} applies only to a delta counter if the counter is a 'BOTH' type counter. (This value can have min 4 to max 60)")
	@ConfigValueType(value = ValueType.COMMA_COLON_SEPARATED_VALUE,
			strings = {"line protocol field\n(reqiured)", "mapping counter name\n(reqiured)", "display name", "unit", "totalizable\ndefault true", "norm. sec.\ndefault 30"},
			booleans = {true, true, false, false, false, false}
			)
	public String _counter_mappings; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"define an obj Family prefix. objectType is defined with some tags.\n" +
			"see input_telegraf_$measurement$_objFamily_append_tags option.")
	public String _objFamily_base; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"this tags's value is appended to objFamily_base.\nIt can have multiple values. eg)tag1,tag2")
	@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
	public String _objFamily_append_tags; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"define an objectType prefix. objectType is defined with some tags.\n" +
			"see input_telegraf_$measurement$_objType_prepend(or append)_tags option.")
	public String input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"this tags's value is prepended to objType_base.\nIt can have multiple values. eg)tag1,tag2")
	@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
	public String _objType_prepend_tags; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"this tags's value is appended to objType_base.\nIt can have multiple values. eg)tag1,tag2")
    @ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
	public String _objType_append_tags; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"this tags's value is object type's icon file name that the scouter client have. eg)redis")
	public String input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"define an objectName prefix. objectName is defined with some tags.\n" +
			"see input_telegraf_$measurement$_objName_append_tags option.")
	public String input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"this tags's value is appended to objName_base.\n" +
			"It can have multiple values. eg)tag1,tag2")
    @ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
	public String _objName_append_tags; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"tag name to define host")
	public String input_telegraf_; @ConfigDesc("[This option is just a sample. Change $measurement$ to your measurement name like $cpu$.]\n" +
			"which host value defined with $measurement$_host_tag option is mapped to scouter's host.\n" +
			"It can have multiple values. eg)hostValue1:scouterHost1,hostValue2:scouterHost2")
	@ConfigValueType(value = ValueType.COMMA_COLON_SEPARATED_VALUE,
			strings = {"telegraf host name(reqiured)", "scouter host name(reqiured)"},
			booleans = {true, true}
	)
	public String input_telegraf_; public boolean visitor_hourly_count_enabled; public Properties property; static boolean WORKABLE; }
@Test public void applyTelegrafInputConfig() { System.setProperty("scouter.config", "./conf/testcase-scouter.conf"); System.setProperty("input_telegraf_$xpu_space$_enabled", "true"); System.setProperty("input_telegraf_$xpu_space$_debug_enabled", "true"); System.setProperty("input_telegraf_$xpu_space$_counter_mappings", "xpu1:Sxpu1,xpu2:Sxpu2:S of xpu 2:%:false"); System.setProperty("input_telegraf_$xpu_space$_objFamily_base", "TGFAMILY01"); System.setProperty("input_telegraf_$xpu_space$_objType_base", "TGTYPE01"); System.setProperty("input_telegraf_$xpu_space$_objType_append_tags", "t1,t2"); System.setProperty("input_telegraf_$xpu_space$_objName_base", "TGNAME01"); System.setProperty("input_telegraf_$xpu_space$_objName_append_tags", "t3,t4"); System.setProperty("input_telegraf_$xpu_space$_host_tag", "tg_host"); System.setProperty("input_telegraf_$xpu_space$_host_mappings", "h1:Sh1,h2:Sh2"); Map<String, ScouterTgMtConfig> configMap = Configure.getInstance().telegrafInputConfigMap; ScouterTgMtConfig tConfig = configMap.get("xpu_space"); Assert.assertEquals(tConfig.isEnabled(), true); Assert.assertEquals(tConfig.isDebugEnabled(), true); Assert.assertEquals(tConfig.getObjFamilyBase(), ScouterTgMtConfig.getPrefix() + System.getProperty("input_telegraf_$xpu_space$_objFamily_base")); Assert.assertEquals(tConfig.getObjTypeBase(), System.getProperty("input_telegraf_$xpu_space$_objType_base")); Assert.assertEquals(tConfig.getObjNameBase(), ScouterTgMtConfig.getPrefix() + System.getProperty("input_telegraf_$xpu_space$_objName_base")); Assert.assertEquals(tConfig.getHostTag(), System.getProperty("input_telegraf_$xpu_space$_host_tag")); Counter xpu1Counter = tConfig.getCounterMapping().get("xpu1"); Assert.assertEquals(xpu1Counter.getName(), "Sxpu1"); Counter xpu2Counter = tConfig.getCounterMapping().get("xpu2"); Assert.assertEquals(xpu2Counter.getName(), "Sxpu2"); Assert.assertEquals(xpu2Counter.getDisplayName(), "S of xpu 2"); Assert.assertEquals(xpu2Counter.getUnit(), "%"); Assert.assertEquals(xpu2Counter.isTotal(), false); Assert.assertTrue(tConfig.getObjTypeAppendTags().contains("t1")); Assert.assertTrue(tConfig.getObjTypeAppendTags().contains("t2")); Assert.assertTrue(tConfig.getObjNameAppendTags().contains("t3")); Assert.assertTrue(tConfig.getObjNameAppendTags().contains("t4")); Assert.assertEquals(tConfig.getHostMapping().get("h1"), "Sh1"); Assert.assertEquals(tConfig.getHostMapping().get("h2"), "Sh2"); }