mysql导入数据表大小写_logstash向es里面导入mysql数据,表字段名称自动变成了小写...

在使用Logstash将MySQL数据导入Elasticsearch(ES)过程中,发现导入后的表字段名称全部转换为小写。这可能导致与原数据库中的大小写敏感字段匹配出现问题。解决方案通常涉及配置Logstash的过滤器,确保在导入时保持原始的大小写格式。
摘要由CSDN通过智能技术生成

public void validateIndexName(String index, ClusterState state) {

if (state.routingTable().hasIndex(index)) {

throw new IndexAlreadyExistsException(new Index(index));

}

if (state.metaData().hasIndex(index)) {

throw new IndexAlreadyExistsException(new Index(index));

}

if (!Strings.validFileName(index)) {

throw new InvalidIndexNameException(new Index(index), index, "must not contain the following characters " + Strings.INVALID_FILENAME_CHARS);

}

if (index.contains("#")) {

throw new InvalidIndexNameException(new Index(index), index, "must not contain '#'");

}

if (index.charAt(0) == '_') {

throw new InvalidIndexNameException(new Index(index), index, "must not start with '_'");

}

if (!index.toLowerCase(Locale.ROOT).equals(index)) {

throw new InvalidIndexNameException(new Index(index), index, "must be lowercase");

}

int byteCount = 0;

try {

byteCount = index.getBytes("UTF-8").length;

} catch (UnsupportedEncodingException e) {

// UTF-8 should always be supported, but rethrow this if it is not for some reason

throw new ElasticsearchException("Unable to determine length of index name", e);

}

if (byteCount > MAX_INDEX_NAME_BYTES) {

throw new InvalidIndexNameException(new Index(index), index,

"index name is too long, (" + byteCount +

" > " + MAX_INDEX_NAME_BYTES + ")");

}

if (state.metaData().hasAlias(index)) {

throw new InvalidIndexNameException(new Index(index), index, "already exists as alias");

}

if (index.equals(".") || index.equals("..")) {

throw new InvalidIndexNameException(new Index(index), index, "must not be '.' or '..'");

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值