Various FlowTraq view combinations may be retrieved via the API by sending requests to:
GET https://example.com/flowtraq/api/v1/stat
Parameter Name | Value | Default Value | Notes |
---|---|---|---|
server | string | "localhost" | The FlowTraq server address. |
port | number | 9640 | The FlowTraq server port. |
auth_token | string | required | A recently acquired authentication token from an authentication request. |
group_by | string | "IP" | A rank entity as described in Retrieving Statistical Queries from the Command Line. |
count_by | string | "BYTES" | A rank field as described in Retrieving Statistical Queries from the Command Line. Use a space to separate the token "unique". |
direction | string | none | Possible values: "snd", "rcv". |
before_time | timestamp | none | A timestamp in the format "MM/DD/YY hh:mm:ss.microsec". |
after_time | timestamp | none | A timestamp in the format "MM/DD/YY hh:mm:ss.microsec". |
time_range | string | -15m | A time specifier as described in Time Navigation. |
query | string | none | A filter string as described in Filter String Syntax. |
rows | number | 10 | The maximum number or rows to return. |
The response will contain either the resulting data table or an error message:
Parameter Name | Value | Notes |
---|---|---|
columns | [string] | An array of column names. |
data | [[string]] | An array of rows, one rank entity per row. Values in each row correspond to the column names in the columns field. |
error | string | Only returned if the request failed. |
For example, using curl in a shell command:
$ curl "https://example.com/flowtraq/api/v1/stat?auth_token=18265a85ca45db35d0a8c263e6dd2c37&group_by=COUNTRY&count_by=BYTES&time_range=-1h"
{"columns":["COUNTRY","SENT BYTES","COLORS","SENT BYTES","RECV BYTES","SENT PCKTS","RECV PCKTS","SESS. INIT","SESS. ACPT","TIME SERIES"],"data":[["192.0.0.7","291953601","9f5afbff","291953601","288067046","597183","592799","1999","2092",["2473710","2478259", ... ]] ... ]}