# Cool logging script

**URL:** <https://forum.alta.inc/t/cool-logging-script/7241>\
**Category:** Routers\
**Created:** [November 19, 2026, 4:02pm UTC](https://forum.alta.inc/t/cool-logging-script/7241 "2026-11-19T16:02:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewhlrr](https://forum.alta.inc/user_avatar/forum.alta.inc/dalewhlrr/32/1780_2.png) [@dalewhlrr](https://forum.alta.inc/u/dalewhlrr)\
**Post date:** [November 19, 2026, 4:02pm UTC](https://forum.alta.inc/t/cool-logging-script/7241/1 "2026-11-19T16:02:10Z")

</div>

If you are like me I like very detailed logs. I created a script that you can add to your post.cfg. Logs your allowed traffic and dropped traffic to see everything working

 ![image](https://forum.alta.inc/uploads/default/original/2X/7/74bd4dcf3a9b307997ce5210c23eff1001f5eea2.png)

> ```auto
> # ============================================
> # 2. Firewall Logging to Graylog
> # ============================================
> 
> # Log only NEW connections and rate-limit events.
> # LOG is non-terminating; existing firewall
> # decisions remain in place.
> 
> LOG_LIMIT="10/min"
> LOG_BURST="20"
> 
> # Create dedicated logging chains.
> iptables -N ALTA_LOG_ALLOW 2>/dev/null
> iptables -N ALTA_LOG_DROP 2>/dev/null
> 
> # Flush only our custom logging chains.
> iptables -F ALTA_LOG_ALLOW
> iptables -F ALTA_LOG_DROP
> 
> iptables -A ALTA_LOG_ALLOW \
> -m conntrack --ctstate NEW \
> -m limit --limit "$LOG_LIMIT" \
> --limit-burst "$LOG_BURST" \
> -j LOG --log-prefix "ALTA-FW-ALLOW: " \
> --log-level 6
> 
> iptables -A ALTA_LOG_DROP \
> -m limit --limit "$LOG_LIMIT" \
> --limit-burst "$LOG_BURST" \
> -j LOG --log-prefix "ALTA-FW-DROP: " \
> --log-level 6
> 
> # ============================================
> # 3. Log LAN/VLAN Allow Decisions
> # ============================================
> 
> # Insert immediately before terminal ACCEPT
> # decisions in the shared LAN destination chain.
> 
> iptables -C zone_lan_dest_ACCEPT \
> -m conntrack --ctstate NEW \
> -j ALTA_LOG_ALLOW 2>/dev/null || \
> iptables -I zone_lan_dest_ACCEPT 1 \
> -m conntrack --ctstate NEW \
> -j ALTA_LOG_ALLOW
> 
> # ============================================
> # 4. Log LAN/VLAN Drop Decisions
> # ============================================
> 
> iptables -C zone_lan_dest_DROP \
> -j ALTA_LOG_DROP 2>/dev/null || \
> iptables -I zone_lan_dest_DROP 1 \
> -j ALTA_LOG_DROP
> 
> # ============================================
> # 5. Log WAN Drop Decisions
> # ============================================
> 
> iptables -C zone_wan_dest_DROP \
> -j ALTA_LOG_DROP 2>/dev/null || \
> iptables -I zone_wan_dest_DROP 1 \
> -j ALTA_LOG_DROP
> 
> iptables -C zone_wan_src_DROP \
> -j ALTA_LOG_DROP 2>/dev/null || \
> iptables -I zone_wan_src_DROP 1 \
> -j ALTA_LOG_DROP
> 
> # ============================================
> # 6. Log VPN and WAN Allow Decisions
> # ============================================
> 
> for CHAIN in \
> zone_wan_dest_ACCEPT \
> zone_vpn_dest_ACCEPT \
> zone_vpnMasq_dest_ACCEPT
> do
> iptables -C "$CHAIN" \
> -m conntrack --ctstate NEW \
> -j ALTA_LOG_ALLOW 2>/dev/null || \
> iptables -I "$CHAIN" 1 \
> -m conntrack --ctstate NEW \
> -j ALTA_LOG_ALLOW
> done
> 
> echo "Alta custom configuration applied."
> 
> ```

---

<div class="post-metadata">

**Author:** ![dalewhlrr](https://forum.alta.inc/user_avatar/forum.alta.inc/dalewhlrr/32/1780_2.png) [@dalewhlrr](https://forum.alta.inc/u/dalewhlrr)\
**Post date:** [November 19, 2026, 5:40pm UTC](https://forum.alta.inc/t/cool-logging-script/7241/2 "2026-11-19T17:40:45Z")

</div>

Made a cool Dashboard to easily read the info too.

 ![image](https://forum.alta.inc/uploads/default/original/2X/5/5dd7b4f82a50005644748fbf91ca7caf3e68bd21.png)
