xcorp::When it rains, it pours.

"The nice thing about rain," said Eeyore, "is that it always stops. Eventually."

LDAP filter

ぬかってた。すっかりぬかってたよ。
以前は、

  • hogeStatus が "hogehoge"
  • fugaHost が "fuga.example.com"
  • piyoCount が 10

なレコードを取得するために、

 (&(hogeStatus=hogehoge)(&(fugaHost=fuga.example.com)(piyoCount=10)))

って filter を書いてたんだけど、これが禿しくまどろっこしかったワケ。
で、この書き方なんとかならんかなあと思って、ググってみたところ、コレ。

 (&(hogeStatus=hogehoge)(fugaHost=fuga.example.com)(piyoCount=10))

これでいいんかいっていう*1。おいちゃん、おクチあんぐり。開いた口がふさがらなかったよ*2
また、

だったら、もちろん

 (&(hogeStatus=foobar)(fugaHost=*.example.com))

って書けるのね。ああ、今までのアレはなんだったんだーって感じですよ。ほんとにもう!! ぷんすか。

*1:どちらの書き方でも期待どおりの結果が得られる

*2:主に自分に対して