Create Time Chart With Fixed Bucket Count

Create a time chart with precise bucket control to visualize HTTP Methods Distribution using timeChart() function

Query

flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1{{Aggregate}} result{{Result Set}} repo --> 1 1 --> result
logscale
timeChart(buckets=10, series=method, function=count())

Introduction

The timeChart() function can be used to create time-based visualizations of data. Instead of specifying a time span, you can control the granularity by setting the exact number of buckets to divide the time range into.

In this example, the timeChart() function is used to create a time series visualization showing the distribution of HTTP methods across exactly 10 time buckets.

Example incoming data might look like this:

@timestampmethodurlstatus_coderesponse_time
2025-08-06T10:00:00ZGET/api/users20045
2025-08-06T10:00:01ZPOST/api/orders201120
2025-08-06T10:00:02ZGET/api/products20035
2025-08-06T10:00:03ZPUT/api/users/12320089
2025-08-06T10:00:04ZDELETE/api/orders/45620067
2025-08-06T10:00:05ZGET/api/inventory20056
2025-08-06T10:00:06ZPOST/api/users20198
2025-08-06T10:00:07ZGET/api/orders20043
2025-08-06T10:00:08ZPATCH/api/products/78920076
2025-08-06T10:00:09ZGET/api/status20023
2025-08-06T10:00:10ZHEAD/api/health20012

Step-by-Step

  1. Starting with the source repository events.

  2. flowchart LR; %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% repo{{Events}} 1{{Aggregate}} result{{Result Set}} repo --> 1 1 --> result style 1 fill:#ff0000,stroke-width:4px,stroke:#000;
    logscale
    timeChart(buckets=10, series=method, function=count())

    Creates a time chart that divides the query time range into exactly 10 equal-width buckets.

    The series parameter groups the data by the method field, creating separate lines for each unique HTTP method.

    The function parameter uses count() to calculate the number of events in each bucket.

    Using buckets instead of a time span ensures consistent granularity regardless of the total time range, making the visualization more predictable and easier to compare across different time ranges. For an example, see Create Time Chart With One-Minute Intervals.

  3. Event Result set.

Summary and Results

The query is used to create a detailed time series visualization showing how the usage of different HTTP methods varies over time, with precise control over the number of data points.

This query is useful, for example, to analyze API usage patterns, detect unusual spikes in specific HTTP methods, or monitor the distribution of request types with consistent granularity regardless of the time range.

If you want to create a time series visualization showing the distribution of HTTP methods within the HUMIO repository, you can use these queries: #kind=requests | timeChart(buckets=10, series=method, function=count()) or just #kind=requests | timeChart(series=method, function=count()).

When the buckets parameter is not specified, LogScale automatically determines an appropriate number of buckets based on the query time range. This ensures optimal visualization regardless of the time span being analyzed.

Sample time chart from the incoming example data will look like this:

Showing Time Chart With Fixed Bucket Count

Note that each HTTP method gets its own column, and the _bucket column represents the start of each time bucket. The values show the count of each method within that bucket.