Querying Analytic Statistics

Querying Analytic Statistics
GET http://<IP_Address>/api/mo/sys/analytics/inst-analytics/fwdinst-65793/dbgStatistics.json
{
    "totalCount": "1",
    "imdata": [
        {
            "analyticsStatistics": {
                "attributes": {
                    "clearTs": "never",
                    "dn": "sys/analytics/inst-analytics/fwdinst-65793/dbgStatistics",
                    "export": "12980",
                    "flowCreateCe": "0",
                    "flowCreateIPv4": "12976",
                    "flowCreateIPv6": "0",
                    "flowHitCe": "0",
                    "flowHitIPv4": "0",
                    "flowHitIPv6": "0",
                    "lastCollectTs": "0",
                    "packetsSeen": "14220",
                    "skipCollect": "1244"
                }
            }
        }
    ]
}
GET:  http://<IP_Address>/restconf/data/Cisco-NX-OS-device:
<analytics-items>
    <inst-items>
        <Inst-list>
            <mode>analytics</mode>
            <adminSt>enabled</adminSt>
            <collector-items>
                <Collector-list>
                    <name>e2</name>
                    <dscp>44</dscp>
                    <dstAddr>10.1.11.2</dstAddr>
                    <dstPort>2000</dstPort>
                    <srcIf>lo0</srcIf>
                    <ver>cisco-v1</ver>
                </Collector-list>
                <Collector-list>
                    <name>e5</name>
                    <dscp>44</dscp>
                    <dstAddr>10.1.11.5</dstAddr>
                    <dstPort>5000</dstPort>
                    <srcIf>lo0</srcIf>
                    <ver>cisco-v1</ver>
                </Collector-list>
                <Collector-list>
                    <name>e3</name>
                    <dscp>44</dscp>
                    <dstAddr>10.1.11.3</dstAddr>
                    <dstPort>3000</dstPort>
                    <srcIf>lo0</srcIf>
                    <ver>cisco-v1</ver>
                </Collector-list>
                <Collector-list>
                    <name>e1</name>
                    <dscp>44</dscp>
                    <dstAddr>10.1.11.1</dstAddr>
                    <dstPort>1000</dstPort>
                    <srcIf>lo0</srcIf>
                    <ver>cisco-v1</ver>
                </Collector-list>
                <Collector-list>
                    <name>e4</name>
                    <dscp>44</dscp>
                    <dstAddr>10.1.11.4</dstAddr>
                    <dstPort>4000</dstPort>
                    <srcIf>lo0</srcIf>
                    <ver>cisco-v1</ver>
                </Collector-list>
            </collector-items>
            <fwdinst-items>
                <FwdInstTarget-list>
                    <id>65793</id>
                    <DefPolicy>permit</DefPolicy>
                    <ceCreate>0</ceCreate>
                    <ceHit>0</ceHit>
                    <collectorId>1234</collectorId>
                    <dbgStatistics-items>
                        <export>58412</export>
                        <flowCreateCe>0</flowCreateCe>
                        <flowCreateIPv4>58408</flowCreateIPv4>
                        <flowCreateIPv6>0</flowCreateIPv6>
                        <flowHitCe>0</flowHitCe>
                        <flowHitIPv4>0</flowHitIPv4>
                        <flowHitIPv6>0</flowHitIPv6>
                        <lastCollectTs>0</lastCollectTs>
                        <packetsSeen>59921</packetsSeen>
                        <skipCollect>1513</skipCollect>
                    </dbgStatistics-items>
                    <dir>in</dir>
                    <fltType>ipv4</fltType>
                    <ipv4Create>0</ipv4Create>
                    <ipv4Hit>0</ipv4Hit>
                    <ipv6Create>0</ipv6Create>
                    <ipv6Hit>0</ipv6Hit>
                    <rspolicyAtt-items>
                        <tCl>analyticsPolicy</tCl>
                        <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/policy-items/Policy-list[name=&apos;abc&apos;]</tDn>
                    </rspolicyAtt-items>
                    <rsprofAtt-items>
                        <tCl>analyticsProfile</tCl>
                        <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/prof-items/Profile-list[name=&apos;h2&apos;]</tDn>
                    </rsprofAtt-items>
                </FwdInstTarget-list>
            </fwdinst-items>
            <monitor-items>
                <Monitor-list>
                    <name>m1</name>
                    <collectorbucket-items>
                        <CollectorBucket-list>
                            <id>1</id>
                            <hashHi>4095</hashHi>
                            <hashLo>0</hashLo>
                            <rscollectorAtt-items>
                                <RsCollectorAtt-list>
                                    <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/collector-items/Collector-list[name=&apos;e1&apos;]</tDn>
                                    <tCl>analyticsCollector</tCl>
                                </RsCollectorAtt-list>
                                <RsCollectorAtt-list>
                                    <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/collector-items/Collector-list[name=&apos;e3&apos;]</tDn>
                                    <tCl>analyticsCollector</tCl>
                                </RsCollectorAtt-list>
                            </rscollectorAtt-items>
                        </CollectorBucket-list>
                        <CollectorBucket-list>
                            <id>2</id>
                            <hashHi>4095</hashHi>
                            <hashLo>2048</hashLo>
                            <rscollectorAtt-items>
                                <RsCollectorAtt-list>
                                    <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/collector-items/Collector-list[name=&apos;e2&apos;]</tDn>
                                    <tCl>analyticsCollector</tCl>
                                </RsCollectorAtt-list>
                                <RsCollectorAtt-list>
                                    <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/collector-items/Collector-list[name=&apos;e4&apos;]</tDn>
                                    <tCl>analyticsCollector</tCl>
                                </RsCollectorAtt-list>
                            </rscollectorAtt-items>
                        </CollectorBucket-list>
                    </collectorbucket-items>
                    <rsrecordPAtt-items>
                        <tCl>analyticsRecordP</tCl>
                        <tDn>/System/analytics-items/inst-items/Inst-list[mode=&apos;analytics&apos;]/recordp-items/RecordP-list[name=&apos;r1&apos;]</tDn>
                    </rsrecordPAtt-items>
                </Monitor-list>
            </monitor-items>
            <operErr/>
            <policy-items>
                <Policy-list>
                    <name>abc</name>
                    <acl-items>
                        <MatchAcl-list>
                            <name>ipv4</name>
                            <fltType>ipv4</fltType>
                        </MatchAcl-list>
                        <MatchAcl-list>
                            <name>ipv6</name>
                            <fltType>ipv6</fltType>
                        </MatchAcl-list>
                    </acl-items>
                </Policy-list>
            </policy-items>
            <prof-items>
                <Profile-list>
                    <name>h2</name>
                    <burstIntvlShift>0</burstIntvlShift>
                    <collectIntvl>100</collectIntvl>
                    <ipPktIdShift>0</ipPktIdShift>
                    <mtu>1500</mtu>
                    <payloadlenbin-items>
                        <PayloadLenBin-list>
                            <id>2</id>
                            <hi>6</hi>
                            <lo>1</lo>
                        </PayloadLenBin-list>
                        <PayloadLenBin-list>
                            <id>1</id>
                            <hi>10</hi>
                            <lo>1</lo>
                        </PayloadLenBin-list>
                    </payloadlenbin-items>
                    <rcvwindowszbin-items>
                        <RcvWindowSzBin-list>
                            <id>3</id>
                            <hi>8</hi>
                            <lo>1</lo>
                        </RcvWindowSzBin-list>
                        <RcvWindowSzBin-list>
                            <id>2</id>
                            <hi>7</hi>
                            <lo>1</lo>
                        </RcvWindowSzBin-list>
                    </rcvwindowszbin-items>
                    <seqNumGuessThreshHi>255</seqNumGuessThreshHi>
                    <seqNumGuessThreshLo>2</seqNumGuessThreshLo>
                    <srcPort>555</srcPort>
                    <tcpopthdrlenbin-items>
                        <TCPOptHdrLenBin-list>
                            <id>1</id>
                            <hi>5</hi>
                            <lo>1</lo>
                        </TCPOptHdrLenBin-list>
                        <TCPOptHdrLenBin-list>
                            <id>2</id>
                            <hi>6</hi>
                            <lo>1</lo>
                        </TCPOptHdrLenBin-list>
                    </tcpopthdrlenbin-items>
                </Profile-list>
            </prof-items>
            <recordp-items>
                <RecordP-list>
                    <name>r1</name>
                    <collect>count-bytes,count-pkts</collect>
                    <match>dst-ipv4,dst-port,proto,src-ipv4,src-port</match>
                </RecordP-list>
            </recordp-items>
        </Inst-list>
    </inst-items>
</analytics-items>

Note: Retrieving analytic statistics requires enabling feature analytics and configuring analytics through a REST POST (pushing all the analytics-related configuration MOs).

Under sys/analytics/inst-analytics/fwdinst-65794/dbgStatistics MO statistics can be found with following counters:

  • flowCreateCe
  • flowCreateIPv4
  • flowCreateIPv6
  • flowHitCe
  • flowHitIPv4
  • flowHitIPv6
  • packetsSeen
  • export
  • skipCollect
  • lastCollectTs