Skip to content

[FEATURE] timechart with option to specify timestamp column, overriding the implicit @timestamp field #4576

Closed

Description

@Trikenstein

Is your feature request related to a problem?
Using PPL version 3.4.0.

The timechart command implicitly requires a timestamp field which must be name exactly @timestamp. When the index has a timestamp column with a different name, the command fails by a runtime error. In the example below, the ocsf-1.1.0-4003 index has a timestamp column named time

source=ocsf-1.1.0-4003
| where TIMESTAMPDIFF(HOUR, time, NOW()) <= 24
| where rcode='NXDomain'
| timechart span=1h COUNT()

Failed with error

{
  "error": {
    "reason": "Invalid Query",
    "details": "Field [@timestamp] not found.",
    "type": "IllegalArgumentException"
  },
  "status": 400
}

What solution would you like?
Provide the timechart command with an option timefield=<FieldName> to use a user-defined timestamp column. The inital query above would then become

timechart timefield=time span=1h COUNT() by rcode

What alternatives have you considered?
As of 2025-10-15, using PPL 3.4.0. The workaround is simply to rename the existing timestamp field to @timestamp to satisfy the implicit harcoded field name required by timechart

source=ocsf-1.1.0-4003
| where TIMESTAMPDIFF(HOUR, time, NOW()) <= 24
| where rcode='NXDomain'
| rename time as @timestamp
| timechart span=1h COUNT()

Activity

  1. added
    PPL
    on Oct 16, 2025
  2. self-assigned this
    on Oct 27, 2025
  3. moved this from Not Started to In review in PPL Trackeron Oct 27, 2025
  4. removed their assignment
    on Oct 27, 2025
  5. moved this from In review to Not Started in PPL Trackeron Oct 27, 2025
  6. moved this from Not Started to Done in PPL Trackeron Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PPLenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions