# Is it possible to properly log protobuf?

**URL:** <https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444>\
**Category:** Technical Forums\
**Tags:** security, devops, application-delivery\
**Created:** [August 13, 2025, 3:35am UTC](https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444 "2025-08-13T03:35:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neeeewbie](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/neeeewbie/32/33782_2.png) [@neeeewbie](https://community.f5.com/u/neeeewbie)\
**Post date:** [August 13, 2025, 3:35am UTC](https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444/1 "2025-08-13T03:35:52Z")

</div>

I’m currently receiving decoded traffic in span mode.  
However, content-type: application/proto is not logged properly.  
Is there a way to resolve this issue?

---

<div class="post-metadata">

**Author:** ![Jeff\_Granieri](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/jeff_granieri/32/8038_2.png) [@Jeff\_Granieri](https://community.f5.com/u/Jeff_Granieri)\
**Post date:** [August 14, 2025, 5:21pm UTC](https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444/2 "2025-08-14T17:21:21Z")

</div>

```auto
when HTTP_REQUEST {
    # Check for Protobuf content-type
    if {[HTTP::header "Content-Type"] contains "application/proto"} {
        # Collect the payload (up to 1MB; adjust size if needed, but beware of performance impact)
        HTTP::collect [HTTP::header "Content-Length"]
    }
}

when HTTP_REQUEST_DATA {
    # Convert binary payload to hex for logging
    set payload [HTTP::payload]
    binary scan $payload H* hex_payload
    log local0. "Protobuf Payload (Hex): $hex_payload | Client IP: [IP::client_addr] | URI: [HTTP::uri]"
    
    # Optional: Release the payload to continue processing
    HTTP::release
}

```

Hello,

You would need to have the traffic sent through a VIP to apply an irule that could potentially do some conversion etc.. I have not tested this so please do this in a non-prod environment!&nbsp; &nbsp;I highly recommend checking out our [F5 AI Assistant Introduces iRules Code Generation for BIG-IP | F5 !](https://www.f5.com/company/blog/f5-ai-assistant-now-delivers-irules-code-generation)

---

<div class="post-metadata">

**Author:** ![neeeewbie](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/neeeewbie/32/33782_2.png) [@neeeewbie](https://community.f5.com/u/neeeewbie)\
**Post date:** [August 18, 2025, 1:43am UTC](https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444/3 "2025-08-18T01:43:57Z")

</div>

Thank you for sharing your knowledge.  
I checked this iRule. To reduce errors, check the Content-Length before using HTTP::collect.

---

<div class="post-metadata">

**Author:** ![neeeewbie](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/neeeewbie/32/33782_2.png) [@neeeewbie](https://community.f5.com/u/neeeewbie)\
**Post date:** [August 19, 2025, 2:42am UTC](https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444/4 "2025-08-19T02:42:33Z")

</div>

How can I use this AI assistant?  
Is it free?

---

<div class="post-metadata">

**Author:** ![Jeff\_Granieri](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/jeff_granieri/32/8038_2.png) [@Jeff\_Granieri](https://community.f5.com/u/Jeff_Granieri)\
**Post date:** [August 19, 2025, 2:57pm UTC](https://community.f5.com/t/is-it-possible-to-properly-log-protobuf/76444/5 "2025-08-19T14:57:45Z")

</div>

Its best to reach out to your F5 Account Team/SE on getting AI assistant setup, its currently free 😀 You can also paste in previous iRules and ask the assistant to explain its functions, very helpful when taking over iRules that others have written
