URL parameters#

The log viewer supports various URL parameters to control its behavior and state. The parameters are divided into two categories:

General rules#

  • Boolean values should use true/false strings.

  • If empty or falsy values are provided, the log-viewer will remove them from the URL on load.

Search parameters#

Search parameters appear after the ? in the URL. When the page loads, the viewer reads these parameters to set its initial state.

Note

Modifying search parameters causes the page to reload.

Parameter

Type

Default

Description

Example

filePath

String

“”

Specifies the log file to load on startup

?filePath=https://example.com/app-log.clp.zst

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst

Below are some important details to be aware of when you’re working with search parameters.

  • A filePath value can be a local file URL or remote HTTP(S) URL.

  • If a filePath value isn’t percent-encoded as per RFC 3986, it must be the last parameter in the URL, to prevent ambiguity with other log viewer search parameters. To include hash parameters in a filePath value, percent-encode the entire value.

  • Relative filePath values are automatically converted to absolute URLs, e.g., http://localhost:3010/?filePath=/test/app.clp.zst downloads the file from http://localhost:3010/test/app.clp.zst.

Hash parameters#

Hash parameters appear after the # in the URL, and are used to control the log viewer’s state.

Note

Modifying hash parameters does NOT cause the page to reload.

Parameter

Type

Default

Description

Example

isPrettified

Boolean

false

Enable/disable pretty printing of log content

#isPrettified=true

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/cockroachdb.clp.zst#isPrettified=true

logEventNum

Number

0

Navigate to a specific log event (1-based index)

#logEventNum=1542

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst#logEventNum=1542

filter

String

“”

Set KQL log filter for kv-pair IR logs

#filter=%40timestamp+%3C+1679969692

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/cockroachdb.clp.zst#filter=%40timestamp+%3C+1679969692

search

String

“”

Set search query string

#search=service%3A+172.31

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst#search=service%3A+172.31

searchIsCaseSensitive

Boolean

false

Enable/disable case-sensitive search

#searchIsCaseSensitive=true

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst#search=RMC&searchIsCaseSensitive=true

searchIsRegex

Boolean

false

Enable/disable regular expression search

#searchIsRegex=true

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst#search=172.*43716&searchIsRegex=true

timestamp

Number

-1

Navigate to the log event closest to the timestamp

#timestamp=1427103813827

Demohttps://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst#timestamp=1427103813827

  • logEventNum is a 1-based index with a default value of 0, indicating no specific log event is selected. When 0, the log viewer loads the page containing the most recent log event.

  • Moving the cursor in the editor automatically updates logEventNum in the URL.

    Note

    This behavior is under review and may be removed in future versions.

  • timestamp values should be given as milliseconds since the Unix epoch, with a default value of -1. We don’t support negative timestamps.

  • When both logEventNum and timestamp are specified, timestamp takes precedence. We strongly recommend that you do not specify both parameters simultaneously.

  • Timestamp navigation behavior:

    • If the log file contains one or more events with the specified timestamp, the viewer navigates to the matched log event that has the lowest index.

    • If no exact match exists, the viewer navigates to the log event closest to and before the specified timestamp, unless all log events are after the specified timestamp. In the latter case, the viewer navigates to the first log event.