---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# LSOFParser - Global

# LSOFParser - Global {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

The LSOFParser script include provides methods to parse the output of the lsof command: `lsof -i4TCP -n -P -F pcnfT`.

Use this script include with a discovery script when you need to parse lsof output.

## LSOFParser - error(String msg) {#ariaid-title2}

Generates the specified error message.
{#r_LSOFP-error_S__table_s4s_td2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| msg | String | The error message |
[Tabelle : 1. Parameters]

{#r_LSOFP-error_S__table_s4s_td2_5t} {#r_LSOFP-error_S__table_t4s_td2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 2. Returns]

{#r_LSOFP-error_S__table_t4s_td2_5t}

## LSOFParser - initFileDescriptor() {#ariaid-title3}

Initializes the file descriptor process.
{#r_LSOFP-initFileDescriptor__table_j5f_kd2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 3. Parameters]

{#r_LSOFP-initFileDescriptor__table_j5f_kd2_5t} {#r_LSOFP-initFileDescriptor__table_k5f_kd2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 4. Returns]

{#r_LSOFP-initFileDescriptor__table_k5f_kd2_5t}

## LSOFParser - initProcess() {#ariaid-title4}

Initializes the parser process.
{#r_LSOFP-initProcess__table_omf_cd2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 5. Parameters]

{#r_LSOFP-initProcess__table_omf_cd2_5t} {#r_LSOFP-initProcess__table_pmf_cd2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 6. Returns]

{#r_LSOFP-initProcess__table_pmf_cd2_5t}

## LSOFParser - on_c(String line) {#ariaid-title5}

Sets the current command.
{#r_LSOFP-on_c_S__table_wqf_fb2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| line | String | The command |
[Tabelle : 7. Parameters]

{#r_LSOFP-on_c_S__table_wqf_fb2_5t} {#r_LSOFP-on_c_S__table_xqf_fb2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 8. Returns]

{#r_LSOFP-on_c_S__table_xqf_fb2_5t}

## LSOFParser - on_endFileDescriptor() {#ariaid-title6}

Closes the file descriptor process.
{#r_LSOFP-on_endFileDescriptor__table_eqx_nc2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 9. Parameters]

{#r_LSOFP-on_endFileDescriptor__table_eqx_nc2_5t} {#r_LSOFP-on_endFileDescriptor__table_fqx_nc2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 10. Returns]

{#r_LSOFP-on_endFileDescriptor__table_fqx_nc2_5t}

## LSOFParser - on_endProcess() {#ariaid-title7}

Closes the parser process.
{#r_LSOFP-on_endProcess__table_ogc_vc2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Tabelle : 11. Parameters]

{#r_LSOFP-on_endProcess__table_ogc_vc2_5t} {#r_LSOFP-on_endProcess__table_pgc_vc2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 12. Returns]

{#r_LSOFP-on_endProcess__table_pgc_vc2_5t}

## LSOFParser - on_f(String line) {#ariaid-title8}

Sets the current file descriptor.
{#r_LSOFP-on_f_S__table_ywq_nb2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| line | String | The file descriptor |
[Tabelle : 13. Parameters]

{#r_LSOFP-on_f_S__table_ywq_nb2_5t} {#r_LSOFP-on_f_S__table_zwq_nb2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 14. Returns]

{#r_LSOFP-on_f_S__table_zwq_nb2_5t}

## LSOFParser - on_n(String line) {#ariaid-title9}

Sets the current address.
{#r_LSOFP-on_n_S__table_lx3_vb2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| line | String | The address |
[Tabelle : 15. Parameters]

{#r_LSOFP-on_n_S__table_lx3_vb2_5t} {#r_LSOFP-on_n_S__table_mx3_vb2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 16. Returns]

{#r_LSOFP-on_n_S__table_mx3_vb2_5t}

## LSOFParser - on_p(String line) {#ariaid-title10}

Sets the current PID.
{#r_LSOFP-on_p_S__table_sm5_v12_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| line | String | The PID |
[Tabelle : 17. Parameters]

{#r_LSOFP-on_p_S__table_sm5_v12_5t} {#r_LSOFP-on_p_S__table_tm5_v12_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 18. Returns]

{#r_LSOFP-on_p_S__table_tm5_v12_5t}

## LSOFParser - on_T(String line) {#ariaid-title11}

Sets the current state.
{#r_LSOFP-on_T_S__table_x2h_fc2_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| line | String | The state |
[Tabelle : 19. Parameters]

{#r_LSOFP-on_T_S__table_x2h_fc2_5t} {#r_LSOFP-on_T_S__table_y2h_fc2_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 20. Returns]

{#r_LSOFP-on_T_S__table_y2h_fc2_5t}

## LSOFParser - parse(String lsofOutput) {#ariaid-title12}

Parses the specified `lsof` output.
Results are available in connections and listeners arrays, and errors are recorded in
errorString() and isValid().
{#r_LSOFP-parse_S__table_lbn_g12_5t__entry__3}

| Name | Type | Description |
|-|-|-|
| lsofOutput | String | The `lsof` output |
[Tabelle : 21. Parameters]

{#r_LSOFP-parse_S__table_lbn_g12_5t} {#r_LSOFP-parse_S__table_mbn_g12_5t__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 22. Returns]

{#r_LSOFP-parse_S__table_mbn_g12_5t}

