Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alnum (text pattern) multi field to host.name and observer.name (help wanted) #1599

Closed

Conversation

ypid-geberit
Copy link
Contributor

@ypid-geberit ypid-geberit commented Sep 2, 2021

The background is to make parts of the FQDN or hostname searchable. Example:

POST _analyze
{
  "analyzer": "pattern",
  "text": "host55-bmc.example.net"
}

Output:

{
  "tokens" : [
    {
      "token" : "host55",
      "start_offset" : 0,
      "end_offset" : 6,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "bmc",
      "start_offset" : 7,
      "end_offset" : 10,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "example",
      "start_offset" : 11,
      "end_offset" : 18,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "net",
      "start_offset" : 19,
      "end_offset" : 22,
      "type" : "word",
      "position" : 3
    }
  ]
}

Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-analyzers.html

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?
  • For proposing substantial changes or additions to the schema, have you reviewed the RFC process?
  • If submitting code/script changes, have you verified all tests pass locally using make test?
  • If submitting schema/fields updates, have you generated new artifacts by running make and committed those changes?
  • Is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
  • Have you added an entry to the CHANGELOG.next.md?

The background is to make parts of the FQDN or hostname searchable.
Example:

```
POST _analyze
{
  "analyzer": "pattern",
  "text": "host55-bmc.example.net"
}
```

Output:

```json
{
  "tokens" : [
    {
      "token" : "host55",
      "start_offset" : 0,
      "end_offset" : 6,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "bmc",
      "start_offset" : 7,
      "end_offset" : 10,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "example",
      "start_offset" : 11,
      "end_offset" : 18,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "net",
      "start_offset" : 19,
      "end_offset" : 22,
      "type" : "word",
      "position" : 3
    }
  ]
}
```
@kgeller
Copy link
Contributor

kgeller commented Sep 3, 2021

@ypid-geberit I think this may be better suited for an RFC. It definitely seems like a straightforward addition, but I think it would be best to get others to weigh in. What do you think?

@ypid-geberit ypid-geberit changed the title Add alnum (text pattern) multi field to host.name and observer.name Add alnum (text pattern) multi field to host.name and observer.name (help wanted) Nov 18, 2021
@ypid-geberit
Copy link
Contributor Author

Thanks, sounds good. I have not gotten around to do it. If someone has the same need, feel free to continue my work. Otherwise, I cannot make promises but maybe in a few months I can consider it again.

@kgeller
Copy link
Contributor

kgeller commented Nov 30, 2021

Going to close this out for now. Feel free to re-open in the future.

@kgeller kgeller closed this Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants