本文整理了Java中com.hurence.logisland.record.Record.removeField
方法的一些代码示例,展示了Record.removeField
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.removeField
方法的具体详情如下:
包路径:com.hurence.logisland.record.Record
类名称:Record
方法名:removeField
暂无
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
private void extractAndParsePropertiesField(Record outputRecord, String propertiesField) {
Field field = outputRecord.getField(propertiesField);
if (field != null) {
String str = field.getRawValue().toString();
Matcher matcher = PROPERTIES_SPLITTER_PATTERN.matcher(str);
while (matcher.find()) {
if (matcher.groupCount() == 2) {
String key = matcher.group(1);
String value = matcher.group(2).trim();
// logger.debug(String.format("field %s = %s", key, value));
outputRecord.setField(key, FieldType.STRING, value);
}
}
outputRecord.removeField("properties");
}
}
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
@Override
public Collection<Record> process(ProcessContext context, Collection<Record> records) {
try {
List<String> fieldsToRemove = Lists.newArrayList(
context.getPropertyValue(FIELDS_TO_REMOVE).asString().split(","));
for (Record record : records) {
new ArrayList<>(record.getAllFields()).forEach(field -> {
String fieldName = field.getName();
if (fieldsToRemove.contains(fieldName)) {
record.removeField(fieldName);
}
});
}
} catch (Exception ex) {
logger.warn("issue while trying to remove field list {} : {}",
context.getPropertyValue(FIELDS_TO_REMOVE).asString(),
ex.toString());
}
return records;
}
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
private void overwriteObsoleteFieldValue(Record record, String fieldName, String newValue) {
final Field fieldToUpdate = record.getField(fieldName);
record.removeField(fieldName);
record.setField(fieldName, fieldToUpdate.getType(), newValue);
}
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
@Override
public Collection<Record> process(ProcessContext context, Collection<Record> records) {
List<Record> outputRecords = (List<Record>) super.process(context, records);
String propertiesField = context.getPropertyValue(PROPERTIES_FIELD).asString();
for (Record outputRecord : outputRecords) {
Field field = outputRecord.getField(propertiesField);
if (field != null) {
String str = field.getRawValue().toString();
Matcher matcher = PROPERTIES_SPLITTER_PATTERN.matcher(str);
while (matcher.find()) {
if (matcher.groupCount() == 2) {
String key = matcher.group(1);
String value = matcher.group(2);
// logger.debug(String.format("field %s = %s", key, value));
outputRecord.setField(key, FieldType.STRING, value);
}
}
outputRecord.removeField("properties");
}
}
return outputRecords;
}
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
private void overwriteObsoleteFieldName(Record record, String normalizedFieldName, String obsoleteFieldName) {
// remove old badly named field
if (record.hasField(obsoleteFieldName)) {
final Field fieldToRename = record.getField(obsoleteFieldName);
record.removeField(obsoleteFieldName);
record.setField(normalizedFieldName, fieldToRename.getType(), fieldToRename.getRawValue());
}
}
代码示例来源:origin: com.hurence.logisland/logisland-cyber-security-plugin
} else
record.removeField(FieldDictionary.RECORD_KEY);
record.removeField(FieldDictionary.RECORD_VALUE);
代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin
for (String obsoleteFieldName : obsoleteFieldNames) {
if (record.hasField(obsoleteFieldName)) {
record.removeField(obsoleteFieldName);
代码示例来源:origin: com.hurence.logisland/logisland-useragent-plugin
record.removeField(userAgentField);
内容来源于网络,如有侵权,请联系作者删除!