Spotlight in Finder excludes system-related directories by default.
mdfind in Terminal to check if it is actually found by Spotlight, but just excluded from Finder's "user-friendly" results:
$ mdfind foo
Needless to say,
/private/var/db is excluded from Spotlight search results when searching using the GUI
Make sure the volume your file is on is included in Spotlight. Check the Spotlight preference pane's exclusions, and
mdutil -s mountpoint, e.g.
mdutil -s / for the system disk:
$ mdutil -s /
You can enable displaying system files by selecting the criteria dropdown (where you select Kind etc.), then Other…. Search for System files, and check it to have it appear in the dropdown list. Whenever you search for system-related files, or want them included, make sure you add this criterion and select are included.
Alternatively, you can also use
mdutil from the command-line, or a third party UI to it without filtering (HoudahSpot comes to mind, but I haven't used it), or use the
locate command-line tool (and perhaps a GUI for it) once you initialize it using the instructions printed when it's not.