我正在尝试通过Influxdb处理对Influxdb中捕获的最新气象预报数据记录的连续查询 . 我还想在Graphana或Chrongraf中展示一些最新的测量领域

我有一个Influx(1.4.2),其数据库充满了预测的气象值 . 测量时间点是在未来240小时内以3小时为间隔的时间点 .

每3小时间隔保存一个测量记录,所有气象数据保存为字段 . 每隔6个小时,我会收到一些测量字段的预测,这些测量字段将在接下来的3个小时内到达未来240小时 .

测量预测位置,forecastIssueTime和step(以3为间隔的003到240之间的数字)保存为TAGS和预测测量 .

我使用时移和与实际测量相关联来计算测量中的确定因子

为了显示最新的预测,我只对最近的forecastIssueTime感兴趣 .

我如何自动呈现例如Grafana中的字段rhm2(相对湿度)或Graphana中的计时码表我可以填充模板变量但是用户必须选择相关的forecastIssueTime条目 I would like the Grafana display to automatically select the must current forecastIssueTime

在Chrongraph I don’t know how to achieve this

在Influxdb I would also like to construct a continuous query that does some aggregation of values for the next 24 hour or 48 hour period based on the most recent forecastIssueTime

在Influxdb CLI我可以执行以下操作我可以通过以下查询识别当前的forecastIssueTimes

使用KEY =“forecastIssueTime”名称显示“GFS_025_FORECAST”中的标记值:GFS_025_FORECAST键值----------------------- ----- forecastIssueTime 2018021706 forecastIssueTime 2018021712 forecastIssueTime 2018021718 forecastIssueTime 2018021800

为了显示最新的预测,我只对forecastIssueTime = 2018021800感兴趣

我可以选择感兴趣的预测测量并使用WHERE子句和GROUPING示例进行聚合 . 我可以手动显示接下来3个小时的所有当前预测测量值 . 但是 I would like to automatically generate the ''2018021718' as currentForecastIssueTime

从“GFS_025_FORECAST”中选择*,其中forecastIssueTime ='2018021718'和step ='003.00'.....显示正确的测量结果.............

我希望实现的内容如下所示 . (嵌套查询)

select * from“GFS_025_FORECAST”,其中init = last(显示来自“GFS_025_FORECAST”的标签值,KEY =“forecastIssueTime”)和step ='003.00'

或者替代(带有变量赋值的多语句)

currentForecastIssueTime = last(使用KEY =“forecastIssueTime”显示来自“GFS_025_FORECAST”的标记值)从“GFS_025_FORECAST”中选择*,其中init =:currentForecastIssueTime:and step ='003.00'

任何建议我如何实现这一点将非常感激,因为我没有找到任何文件支持这许多感谢,如果有人可以帮助我请 .