# Reuse FilterX blocks

To use a FilterX block in multiple log paths, you have to define it as a separate block:
```
 
    block filterx <identifier>() {
        <filterx-statement-1>;
        <filterx-statement-2>;
        ...
    };
    
```

Then use it in a log path:
```
 
    log {
        source(s1);
        filterx(<identifier>);
        destination(d1);
    };
    
```

For example, the following FilterX statement selects the messages that contain the word `deny` and come from the host `example`.
```
 
    block filterx demo_filterx() {
        ${HOST} == "example";
        ${MESSAGE} =~ "deny";
    };
    log {
        source(s1);
        filter(demo_filterx);
        destination(d1);
    };
    
```

Last modified September 26, 2024: [Rename filterx to FilterX unless it's code (2ace9155)](<https://github.com/axoflow/axosyslog-core-docs/commit/2ace91557f49adced22d5984dbe513bafda08ce0>)