# How to select the last number of log entries using DPL

**URL:** <https://community.dynatrace.com/t/how-to-select-the-last-number-of-log-entries-using-dpl/41127>\
**Category:** DQL\
**Tags:** dql, grail, logs\
**Created:** [August 9, 2023, 11:05am UTC](https://community.dynatrace.com/t/how-to-select-the-last-number-of-log-entries-using-dpl/41127 "2023-08-09T11:05:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alibasharat](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@alibasharat](https://community.dynatrace.com/u/alibasharat)\
**Post date:** [August 9, 2023, 11:05am UTC](https://community.dynatrace.com/t/how-to-select-the-last-number-of-log-entries-using-dpl/41127/1 "2023-08-09T11:05:05Z")

</div>

Hello team,

I have a use case where I am trying to capture the status code from the log entries using DPL.

Please take a look at this log entry:

[https://c](https://c)\*\*\*.c\*\*\*v.aws.\*\*\*\*\*.com/ cn-\*\*\*.\*\*\*.aws.\*\*\*.com 200 0 0 313 4837 210 10.3.7.508

I am trying to capture the status code 200 from the above log entry. The condition which i can think of is that from the last .com capture 3 digits integer.

Note: Please keep in mind that the logs are not one single line. They are huge entries and the status code is always on the last line including the IP address, etc..

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [August 9, 2023, 11:54am UTC](https://community.dynatrace.com/t/how-to-select-the-last-number-of-log-entries-using-dpl/41127/2 "2023-08-09T11:54:41Z")

</div>

Hi&nbsp;[@alibasharat](https://community.dynatrace.com/user/65719)

Please try following pattern

```markup
DATA{0,10000} (<<'.com ' INT:statuscode)

```

Best,  
Sini

---

<div class="post-metadata">

**Author:** ![alibasharat](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@alibasharat](https://community.dynatrace.com/u/alibasharat)\
**Post date:** [August 9, 2023, 12:47pm UTC](https://community.dynatrace.com/t/how-to-select-the-last-number-of-log-entries-using-dpl/41127/3 "2023-08-09T12:47:03Z")

</div>

Thank you Sini.
