# \[hledger\] Auto posting that excludes previously matched postings

**URL:** <https://forum.plaintextaccounting.org/t/hledger-auto-posting-that-excludes-previously-matched-postings/68>\
**Category:** Reddit\
**Tags:** hledger\
**Created:** [March 9, 2024, 12:59am UTC](https://forum.plaintextaccounting.org/t/hledger-auto-posting-that-excludes-previously-matched-postings/68 "2024-03-09T00:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![redditbot](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/redditbot/32/42_2.png) [@redditbot](https://forum.plaintextaccounting.org/u/redditbot)\
**Post date:** [March 9, 2024, 12:59am UTC](https://forum.plaintextaccounting.org/t/hledger-auto-posting-that-excludes-previously-matched-postings/68/1 "2024-03-09T00:59:36Z")

</div>

Using hledger, is it possible to write an auto posting rule that excludes previously matched postings? I expected I could use `tag:_generated-posting`, but it's not working with auto postings. It matches the expected transactions when I check with `areg` though.

 

For instance:

 

```
= expenses:rent [budget:rent] *-1 [assets:checking] *1 = expenses AND not:tag:_generated-posting [budget:undeclared] *-1 [assets:checking] *1 
```

 

I'm trying to set up envelope style budgeting à la [https://frdmtoplay.com/envelope-budgeting-with-ledger/](https://frdmtoplay.com/envelope-budgeting-with-ledger/), but without having the manually write a `not:expr:"{every single previously matched expense account} "`

 

I'm happy to add more detail if it helps. I'm hoping it's a bug and not an impossibility.

 

edit: A complete example:

 

```
= expenses:rent AND not:tag:_modified [assets:budget:rent] *-1 [assets:checking] *1 = expenses AND not:tag:_modified [assets:budget:undeclared] *-1 [assets:checking] *1 2024-03-01 * Budget [assets:budget:rent] 1200.00 USD [assets:checking] -1200.00 USD 2024-03-01 * Opening Balance assets:checking 2000.00 USD equity 2024-03-02 * Landlord expenses:rent 1200.00 USD assets:checking -1200.00 USD 2024-03-03 * Grocery Store expenses:groceries 80.00 USD assets:checking -80.00 USD 
```

 
 submitted by [/u/72n40](https://www.reddit.com/user/72n40)   
 [[link]](https://www.reddit.com/r/plaintextaccounting/comments/1b7nznb/hledger_auto_posting_that_excludes_previously/)[[comments]](https://www.reddit.com/r/plaintextaccounting/comments/1b7nznb/hledger_auto_posting_that_excludes_previously/)
* * *
This is a companion discussion topic for the original entry at [https://www.reddit.com/r/plaintextaccounting/comments/1b7nznb/hledger\_auto\_posting\_that\_excludes\_previously/](https://www.reddit.com/r/plaintextaccounting/comments/1b7nznb/hledger_auto_posting_that_excludes_previously/)
