Skip to content

[Bug] es catalog parse field error #24863

Closed
@qidaye

Description

Search before asking

  • I had searched in the issues and found no similar issues.

Version

master

What's Wrong?

image

1105 - errCode = 2, detailMessage =(172.17.132.126)[CANCELLED]IRUNTIME ERROR]Expected value of type:DATETIMEV2: but found type: Varchar/Char:Document slice is :"2023-04-17T23:01:18.151"

What You Expected?

Query success.

How to Reproduce?

  1. Create ES index

curl -sXPUT localhost:9200/test?pretty -H'Content-Type:application/json' -d'
{
  "settings" : {"number_of_replicas":0},
  "mappings": {
      "properties": {
        "action": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "action_result": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "collect_name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "data_source_address": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "data_type": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "destination_port": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "device_type": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "id": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "in_date": {
          "type": "date"
        },
        "ip_type": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "platform_code": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "platform_department": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "real_name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "request_data": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "request_path": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "response_body": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "role": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "scene_id": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_city": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_country": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_ip": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_region": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "source_state": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "src_message": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "type": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "user_name": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "uuid": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        }
      }
    }
}'
  1. Add an doc
curl -sXPUT localhost:9200/test/_doc/1?pretty -H'Content-Type:application/json' -d'
{
  "destination_country": null,
  "data_source_address": "xxx",
  "role": null,
  "destination_port": "",
  "in_date": "2023-06-12T16:30:01.092",
  "action_result": "{\"body\":{\"code\":0,\"message\":\"opt正确\"},\"headers\":{},\"statusCode\":\"OK\",\"statusCodeValue\":200}",
  "user_name": "lihaonan",
  "description": null,
  "response_body": "",
  "device_type": "xxx",
  "real_name": "xxx",
  "type": "HOST_OPER_DATA",
  "uuid": "xxx",
  "src_message": "",
  "source_ip": "180.168.249.243",
  "device_name": null,
  "destination_ip": null,
  "event_type": null,
  "platform_department": "xxx",
  "source_port": null,
  "action": "xxx",
  "id": "O1685432061620senLelaF",
  "request_protocol": null,
  "destination_state": null,
  "user_status": null,
  "source_city": "上海",
  "scene_id": "202210180001A",
  "destination_region": null,
  "ip_type": "PUBLIC",
  "destination_city": null,
  "device_ip": null,
  "app_name": null,
  "platform_code": "sec-iam-helper",
  "source_country": "中国",
  "collect_name": "xxx",
  "data_type": "log",
  "event_name": null,
  "event_level": null,
  "request_path": "/api/v2/users/verifySmsOrOpt",
  "source_region": "上海",
  "source_state": "亚洲",
  "request_domain": null,
  "request_data": "{\"verifySmsOrOptReq\":{\"uid\":\"13458\",\"passcode\":\"321030\"},\"type\":\"\\\"totp\\\"\"}"
  }'
  1. Create ES catalog
CREATE CATALOG es PROPERTIES (
  "type"="es",
  "hosts"="http://127.0.0.1:9200"
);
  1. Query error

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions