> For the complete documentation index, see [llms.txt](https://oguzhaninan.gitbook.io/varnish-cache/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oguzhaninan.gitbook.io/varnish-cache/varnish-yapilandirma-dili-vcl/untitled/oezel-alt-rutinler.md).

# Özel Alt Rutinler

Kendi alt rutinlerinizi tanımlayabilir ve VCL kodunuzda kullanabilirsiniz. Özel alt yordamlar, çoğunlukla kod çoğaltmasını azaltmak amacıyla VCL kodunu düzenlemek ve modülerleştirmek için kullanılabilir. Aşağıdaki örnek, düzenli ifadeler kullanarak cookie'deki bazı değerleri değiştiren **remove\_ga\_cookies** isimli alt yordamdan oluşur. Google Analytics izleme çerezlerinin gelen istekten kaldırılması işini yapar.

```c
sub remove_ga_cookies {
 # Remove any Google Analytics based cookies
 set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");
 set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", "");
 set req.http.Cookie = regsuball(req.http.Cookie, "_gat=[^;]+(; )?", "");
 set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", "");
}
```

Tanımladığımız özel alt yordamı aşağıdaki şekilde gerekli yerlerde kullanabiliriz.

```c
sub vcl_recv {
 call remove_ga_cookies;
}
```
