Displaying subinterface statistics

To display statistics for a specific subinterface, enter the context for the subinterface and use the info from state command.

--{ candidate shared default }--[  ]--
# interface ethernet-1/2
--{ candidate shared default }--[ interface ethernet-1/2 ]--
# subinterface 1
--{ candidate shared default }--[ interface ethernet-1/2 subinterface 1 ]--
# info from state
    admin-state enable
    ip-mtu 1500
    ifindex 32769
    oper-state up
    last-change 2019-09-30T16:39:29.725Z
    ipv4 {
        allow-directed-broadcast false
        address 192.168.12.2/30 {
            origin static
        }
        arp {
            timeout 14400
            neighbor 192.168.12.1 {
                link-layer-address 00:01:01:FF:00:01
                origin dynamic
                expiration-time 2019-09-30T20:39:30.591Z
            }
        }
    }
    ipv6 {
        address 2001:1::192:168:12:2/126 {
            origin static
            status preferred
        }
        address fe80::201:3ff:feff:1/64 {
            origin link-layer
            status preferred
        }
        neighbor-discovery {
            dup-addr-detect true
            reachable-time 30
            stale-time 14400
            neighbor 2001:1::192:168:12:1 {
                link-layer-address 00:01:01:FF:00:01
                origin dynamic
                is-router true
                current-state reachable
                next-state-time 2019-09-30T17:26:30.018Z
            }
            neighbor fe80::201:1ff:feff:1 {
                link-layer-address 00:01:01:FF:00:01
                origin dynamic
                is-router true
                current-state stale
                next-state-time 2019-09-30T20:40:16.078Z
            }
        }
    }
    statistics {
        in-pkts 564
        in-octets 49394
        in-error-pkts 0
        in-discarded-pkts 0
        in-terminated-pkts 560
        in-terminated-octets 49054
        in-forwarded-pkts 4
        in-forwarded-octets 340
        out-forwarded-pkts 0
        out-forwarded-octets 0
        out-error-pkts 0
        out-discarded-pkts 0
        out-pkts 0
        out-octets 0
    }
    acl {
    }
    qos {
        input {
            classifiers {
                ipv4-dscp default
                ipv6-dscp default
                mpls-tc default
            }
        }
    }

Clearing subinterface statistics

You can clear the statistics counters for a specified subinterface.

# tools interface ethernet-1/1 subinterface 1 statistics clear
/interface[name=ethernet-1/1]/subinterface[index=1]:
    subinterface ethernet-1/1.1 statistics cleared