Splunk Search

What causes timechart to start drawing with recent data but change time periods, lopping off recent results?

jschlachet_splu
Splunk Employee
Splunk Employee

I'm looking for unique local/foreign pairs in netstat output to track the number of tcp connections in TIME_WAIT on a server. Here's my query:

index=esos host=web5 sourcetype=netstat earliest=-4d latest=now
| multikv
| eval pair = LocalAddress + "-" + ForeignAddress
| search State=TIME_WAIT LocalAddress!="::ffff:*" | dedup pair | timechart span=5m dc(pair)

When I click search and watch the chart draw, in the beginning it shows the latest data. I'm investigating a recent phenomenon and want to visually compare it to the past several days. While the graph accumulates more data, the time period of the chart eventually changes, lopping off much of the recent data. What causes this, and how can I still get a timechart of this data with relatively high resolution?

1 Solution

hexx
Splunk Employee
Splunk Employee

What is happening here is that by forcing a time span of 5 minutes for the timechart command, you are generating more data points per series than the JSchart library supports:

Searches that return too many results per series can cause JSChart to hang the browser. Splunk employs a throttling strategy that restricts the number of results returned per series to 500 by default.

Let's say that in your case, you are running that search over the past 4 days. The timechart command with "span=5m" will generate up to 1,152 results, given that there can be that many 5-minute time slices in a 4-day period. This exceeds the per-series of JSchart by 652 data points.

What I would recommend is to use the "bins=200" directive instead of forcing a span for your time slices. By giving a target number of data points, timechart will always return a number of results manageable by JSchart, regardless of the time range picked.

index=esos host=web5 sourcetype=netstat earliest=-4d latest=now 
| multikv 
| eval pair = LocalAddress + "-" + ForeignAddress 
| search State=TIME_WAIT LocalAddress!="::ffff:*"
| dedup pair
| timechart bins=200 dc(pair)

View solution in original post

hexx
Splunk Employee
Splunk Employee

What is happening here is that by forcing a time span of 5 minutes for the timechart command, you are generating more data points per series than the JSchart library supports:

Searches that return too many results per series can cause JSChart to hang the browser. Splunk employs a throttling strategy that restricts the number of results returned per series to 500 by default.

Let's say that in your case, you are running that search over the past 4 days. The timechart command with "span=5m" will generate up to 1,152 results, given that there can be that many 5-minute time slices in a 4-day period. This exceeds the per-series of JSchart by 652 data points.

What I would recommend is to use the "bins=200" directive instead of forcing a span for your time slices. By giving a target number of data points, timechart will always return a number of results manageable by JSchart, regardless of the time range picked.

index=esos host=web5 sourcetype=netstat earliest=-4d latest=now 
| multikv 
| eval pair = LocalAddress + "-" + ForeignAddress 
| search State=TIME_WAIT LocalAddress!="::ffff:*"
| dedup pair
| timechart bins=200 dc(pair)
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...