One of possible ways to do that is to have two queries, one to get Min_Time and another to get Max_Time for every IP.
Sample query A:
from(bucket: "TEST")
|> range(start: -1mo, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "log"
and r._field == "message"
and r.host == "grafana.host.de"
|> group(columns:["_value"])
|> first()
|> group()
|> keep(columns:["_time", "_value"])
|> rename(columns: {_time : "Min_Time", _value : "IP"})
Sample query B:
from(bucket: "TEST")
|> range(start: -1mo, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "log"
and r._field == "message"
and r.host == "grafana.host.de"
|> group(columns:["_value"])
|> last()
|> group()
|> keep(columns:["_time", "_value"])
|> rename(columns: {_time : "Max_Time", _value : "IP"})
To get the format you need in one table it is possible to use Join by field transformation:
To have YYYY-MM-DD format you can override unit for time columns:


