I have elasticsearch cluster running fine. When I run the below command, I get all the messages:
GET myindex/fluentd/_search?sort=@timestamp:desc
Now the above command gives me all the logs with respect to the timestamp in descending order. Below is the logs looks like:
{
"_index": "myindex",
"_type": "fluentd",
"_id": "ZFVk8mMB3x3ftHjXD16B",
"_score": null,
"_source": {
"datatime": "Jun 12 05:06:11",
"username": "user1",
"msg": "Running elasticsearch",
"hostname": "user1",
"@timestamp": "2018-06-12T05:06:11.000000000+00:00"
},
"sort": [
1528779971000
]
},
What command can I run to extract just the msg field of the source from all the logs with respect to time in descending order?
Thanks