Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Tailing a MID server log file on Linux and Windows - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Tailing a MID server log file on Linux and Windows
KB0534869

Tailing a MID server log file on Linux and Windows


2412 Views Last updated : Apr 30, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

At times when working with a customer to review MID server issues, it is useful to tail the MID server logfiles. This way, one can review what is happening in real time, as commands are being run through the MID server.

As new lines are written to the logfile, they will be displayed to the screen. 

Linux and Unix

On Linux and UNIX the tail command is available and is used as follows:

# tail -f agent0.log.0

The last 10x lines of the file will be displayed, and further lines will be displayed as they are written into the logfile.

One can also use the grep command to filter for specific input. For instance, if you only wish to display any Warning messages (ignoring the case sensitivy), use the following:

# tail -f agent0.log.0 | grep -i "warning"

To break out of the command use the following:

<CTRL>c

Windows

On Windows there are a number of applications available that can provide the same functionality as the Linux tail command. Notepad++ has a plugin available called Document Monitor, LogExpert, Tail for Win32, etc.

However, it is also possible to tail a file directly using PowerShell, and this is done as follows, from a PowerShell command window:

PS C:\ Get-Content agent0.log.0 -Wait

Unlike the Linux command, which displays only the last 10x lines of the file first while waiting for further input, the above command will display the whole contents of the file, before it reaches the last line of the file and awaits further input. Therefore if the file is large, be prepared for the whole contents of the file to be displayed to the screen first.

Like the tail command in Linux, it is also possible to filter for specific messages. For instance, if you only wish to display any Warning messages (case insensitive), use the following:

PS C:\ Get-Content agent0.log.0 -Wait | where { $_ -match "warning" }

To break out of the command use the following:

<CTRL>c


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.