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

[BUG] rule.level not sortable #483

Closed
Orgoth opened this issue Jan 14, 2025 · 3 comments
Closed

[BUG] rule.level not sortable #483

Orgoth opened this issue Jan 14, 2025 · 3 comments
Assignees
Labels
reporter/community Issue reported by the community

Comments

@Orgoth
Copy link

Orgoth commented Jan 14, 2025

Describe the bug

/app/threat-hunting#/overview/?tab=general&tabView=events
It is not possible to sort by rule.level, regardless of the configuration, the sorting is not applied.

To Reproduce
Steps to reproduce the behavior:

  1. /app/threat-hunting#/overview/?tab=general&tabView=events
  2. Click on arrow down on the rule.level table/column header
  3. Sort A-Z or Sort Z-A
  4. nothing changes
{
  "params": {
    "index": "wazuh-alerts-*",
    "body": {
      "sort": [
        {
          "timestamp": {
            "order": "desc",
            "unmapped_type": "boolean"
          }
        },
        {
          "rule.level": {
            "order": "asc",
            "unmapped_type": "boolean"
          }
        }
      ],
      "size": 15,
      "from": 0,
      "stored_fields": [
        "*"
      ],
      "script_fields": {},
      "docvalue_fields": [
        {
          "field": "data.aws.createdAt",
          "format": "date_time"
        },
        {
          "field": "data.aws.end",
          "format": "date_time"
        },
        {
          "field": "data.aws.resource.instanceDetails.launchTime",
          "format": "date_time"
        },
        {
          "field": "data.aws.service.eventFirstSeen",
          "format": "date_time"
        },
        {
          "field": "data.aws.service.eventLastSeen",
          "format": "date_time"
        },
        {
          "field": "data.aws.start",
          "format": "date_time"
        },
        {
          "field": "data.aws.updatedAt",
          "format": "date_time"
        },
        {
          "field": "data.ms-graph.createdDateTime",
          "format": "date_time"
        },
        {
          "field": "data.ms-graph.firstActivityDateTime",
          "format": "date_time"
        },
        {
          "field": "data.ms-graph.lastActivityDateTime",
          "format": "date_time"
        },
        {
          "field": "data.ms-graph.lastUpdateDateTime",
          "format": "date_time"
        },
        {
          "field": "data.ms-graph.resolvedDateTime",
          "format": "date_time"
        },
        {
          "field": "data.timestamp",
          "format": "date_time"
        },
        {
          "field": "data.vulnerability.published",
          "format": "date_time"
        },
        {
          "field": "data.vulnerability.updated",
          "format": "date_time"
        },
        {
          "field": "syscheck.mtime_after",
          "format": "date_time"
        },
        {
          "field": "syscheck.mtime_before",
          "format": "date_time"
        },
        {
          "field": "timestamp",
          "format": "date_time"
        }
      ],
      "_source": {
        "excludes": [
          "@timestamp"
        ]
      },
      "query": {
        "bool": {
          "must": [],
          "filter": [
            {
              "match_all": {}
            },
            {
              "match_phrase": {
                "manager.name": {
                  "query": "wazuh.example.de"
                }
              }
            },
            {
              "match_phrase": {
                "agent.name": "PC-Chris"
              }
            },
            {
              "range": {
                "timestamp": {
                  "gte": "2025-01-13T14:06:46.969Z",
                  "lte": "2025-01-14T14:06:46.970Z",
                  "format": "strict_date_optional_time"
                }
              }
            }
          ],
          "should": [],
          "must_not": []
        }
      }
    },
    "preference": 1736862125153
  }
}

Expected behavior
Sorting should be applies and for example:
Sort A-Z should result in 1-100
Sort Z-A should result in 100-1

Dashboards Version
4.10

Screenshots

Image
Image

Host/Environment (please complete the following information):

  • OS: Kubuntu 22.04 LTS
  • Chrome Version 131.0.6778.264 (Offizieller Build) (64-Bit)
@Desvelao
Copy link
Member

According to the evidence of the request paylod:

"sort": [
        {
          "timestamp": {
            "order": "desc",
            "unmapped_type": "boolean"
          }
        },
        {
          "rule.level": {
            "order": "asc",
            "unmapped_type": "boolean"
          }
        }
      ],

this is sorting by the following fields in order:

  • timestamp (first sort)
  • rule.level (second sort)

This sorting means the results are firstly sorted by timestamp and then by rule.level (events with the same timestamp are sorted by the rule.level).

If changing the sorting value for the second sorting field (rule.level) from A-Z to Z-A does not change apparently, this is related to the first sorting field (timestamp).

@Orgoth
Copy link
Author

Orgoth commented Jan 28, 2025

I am unable to change this, since I am only clicking on the table column and then on sort A-Z, how can i remove the time sorting?!

          "timestamp": {
            "order": "desc",
            "unmapped_type": "boolean"
          }
        }

This is added by the dashboard without an option to remove it!

@Orgoth Orgoth closed this as completed Jan 28, 2025
@Desvelao
Copy link
Member

You can remove the sorting of the timestamp field through the fields sorted button:

Image

@Desvelao Desvelao self-assigned this Jan 28, 2025
@Desvelao Desvelao added reporter/community Issue reported by the community and removed untriaged labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reporter/community Issue reported by the community
Projects
None yet
Development

No branches or pull requests

2 participants