NAME
    Parse::Netstat - Parse netstat output

VERSION
    This document describes version 0.10 of Parse::Netstat (from Perl
    distribution Parse-Netstat), released on 2014-12-01.

SYNOPSIS
     use Parse::Netstat qw(parse_netstat);
     my $res = parse_netstat(output => join("", `netstat -anp`), flavor=>'linux');

FUNCTIONS
  parse_netstat(%args) -> [status, msg, result, meta]
    Parse the output of "netstat" command.

    Examples:

     parse_netstat();
    This program support several flavors of netstat. The default flavor is C<linux>.
    See C<--flavor> on how to set flavor.

    Since different flavors provide different fields and same-named fields
    might contain data in different format, please see the sample parse
    output for each flavor you want to support and adjust accordingly.

    Arguments ('*' denotes required arguments):

    *   flavor => *str* (default: "linux")

        Flavor of netstat.

        For Linux, it supports the output of "netstat -an" or "netstat
        -anp".

        For FreeBSD, it supports "netstat" or "netstat -an".

        For Solaris, it supports "netstat".

        For Windows, it supports "netstat" or "netstat -an" or "netstat
        -anp".

    *   output* => *str*

        Output of netstat command.

        This function only parses program's output. You need to invoke
        "netstat" on your own.

    *   tcp => *bool* (default: 1)

        Whether to parse TCP connections.

    *   udp => *bool* (default: 1)

        Whether to parse UDP connections.

    *   unix => *bool* (default: 1)

        Whether to parse Unix socket connections.

    Return value:

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (result) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

     (any)

SEE ALSO
    Parse::Netstat::* for per-flavor notes and sample outputs.

    App::ParseNetstat provides a CLI for this module.

HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/Parse-Netstat>.

SOURCE
    Source repository is at
    <https://github.com/sharyanto/perl-Parse-Netstat>.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    <https://rt.cpan.org/Public/Dist/Display.html?Name=Parse-Netstat>

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

AUTHOR
    perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2014 by perlancar@cpan.org.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

