Number search lines

To make reading your searches easier, you can display line numbers in the Search bar. The following image shows both line numbers and auto-formatting turned on.

This screen image shows a search in the Search bar with line numbers. Line numbers are highlighted on the left side of the image.

Turn on line numbering

By default, line numbering is turned off. You turn on line numbering in the Preferences dialog box.

  1. On the Splunk bar, select [User_account_name] > Preferences.
  2. Click SPL Editor.
  3. Confirm that Advanced editor is turned on.
  4. On the General tab, click Line numbers.
  5. Click Apply.

Changing the options in the Preferences dialog box changes the setting only for you. It does not impact the preferences set for other users. See Change the default Search preferences for all users.

A row in the Search bar is not a line

The line numbering feature applies numbers only to lines. A row in the Search bar is not necessarily a line. You might have a long line that spans multiple rows in the Search bar but is still only one line.

For example, if you paste a long search into the Search bar that has not been formatted with multiple lines, the search has one line number and spans multiple rows.

You can create lines in the Search bar by using the following methods.

  • The Search auto-formatting feature is turned on and you type a pipe character or left square bracket.
  • You use the Search bar shortcuts to auto-format the current search.
  • You press Shift + Enter to split the active row at the cursor. Pressing Enter does not create a new line in the Search bar.