# Get message field of last event

**URL:** <https://discuss.elastic.co/t/get-message-field-of-last-event/210735>\
**Category:** Logstash\
**Created:** [December 5, 2019, 2:55pm UTC](https://discuss.elastic.co/t/get-message-field-of-last-event/210735 "2019-12-05T14:55:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ja123](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@ja123](https://discuss.elastic.co/u/ja123)\
**Post date:** [December 5, 2019, 2:55pm UTC](https://discuss.elastic.co/t/get-message-field-of-last-event/210735/1 "2019-12-05T14:55:34Z")

</div>

How can I get the message field of previous event in elasticsearch? The document ID is dynamically

> {  
> "request" : {  
> "url" : "[https://reiseauskunft.bahn.de/bin/stboard.exe/dn?rt=1&input=Stuttgart%20Hauptbahnhof&boardType=dep&L=vs\_java3&productsFilter=111110111&start=yes&maxJourneys=20](https://reiseauskunft.bahn.de/bin/stboard.exe/dn?rt=1&input=Stuttgart%20Hauptbahnhof&boardType=dep&L=vs_java3&productsFilter=111110111&start=yes&maxJourneys=20)",  
> "method" : "get"  
> },  
> "times\_retried" : 0,  
> "response\_message" : "OK",  
> "name" : "test2",  
> "code" : 200  
> },  
> "@timestamp" : "2019-12-05T14:21:46.498Z",  
> "message" : "\<Journey fpTime="15:14" fpDate="05.12.19" delay="+ 17" e\_delay="17" newpl="15" platform="16" targetLoc="München Hbf" dirnr="8000261" prod="ICE 597#ICE" administration="80\_\_\_\_" is\_reachable="0" delayReason=" Verspätung eines vorausfahrenden Zuges" approxDelay="0"\>\<Journey fpTime="15:16" fpDate="05.12.19" delay="+ 15" e\_delay="15" platform="3" targetLoc="Singen(Hohentwiel)" dirnr="8000073" prod="RE 52389#RE" dir="Singen(Hohentwiel)" administration="NZ\_\_\_\_" is\_reachable="0" delayReason=" Verspätung aus vorheriger Fahrt" approxDelay="0"\>\<Journey fpTime="15:16" fpDate="05.12.19" delay="+ 15" e\_delay="15" platform="3"  
> "tags" : [  
> "\_elasticsearch\_lookup\_failure"  
> ]  
> }

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2020, 3:01pm UTC](https://discuss.elastic.co/t/get-message-field-of-last-event/210735/2 "2020-01-02T15:01:11Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
