Search the Confluence 4.1.x Documentation:

Index
Downloads (PDF, HTML & XML formats)
Other versions

This documentation relates to Confluence 4.1.x
If you are using an earlier version, please view the previous versions of the Confluence documentation and select the relevant version.
Skip to end of metadata
Go to start of metadata

See tech doc writer Sarah Maddox's blog for how to do this in Confluence 3.5 or later.

 Expand to see pre-Confluence 3.5 SQL

Illegal Search Terms

Several terms are illegal to use when searching Confluence, like : or {. If you search for just the macro term, you're likely not to get the right search results. For example, searching for 'usage', which is the name of a macro but also a common English word, will not yield an accurate count.

Query the Database

If, for example you want to search for the uses of the usage macro, you can search the database:

For large instances of Confluence, searches across the entire bodycontent table of the database might be expensive. You can try this on a test server.

You might want to use the SQL Plugin to automate this, or better yet the Macro usage stats plugin. Note that these are third party (unsupported) plugins.

If you want to get the last users or the creators of the pages where the noformat macro is used, you might run:

Listing the occurences of the excerpt include macro (MYSQL only)

Logging Uses of a Macro

This information won't tell you how often a macro is invoked - rather how often it appears on pages. For counting how often it's invoked (and measuring the time it takes to invoke it), check Identifying Slow Performing Macros.

Counting the Incidents of Invoked Logs

You can then grep the logs like:

grep -c "{usage" atlassian-confluence.log
 
Labels:
  1. Mar 13, 2009

    Hi,

    this sounds hardly like an alternative. Why not make it possible to use escape characters for those characters?

    Regards, Herman.

    1. Mar 13, 2009

      Hi Herman~

      You'll probably want to create an issue for your request in the Confluence project, so that the product team is aware of it and you can watch for progress. I did a quick search and didn't see this request there already.

      ~Cheryl

  2. Mar 26, 2009

    We've found it useful to run queries like this, exporting the results to Excel that we can pass on to Space Administrators. It's especially helpful if we include the Space Name or Space Key plus a URL to launch the page in view or edit mode. Adding the check for content_status eliminates deleted pages from the results.

    The following works for Microsoft SQL Server 2000 and 2005:

  3. Sep 04, 2009

    For Confluence 3.0.1 - I have tested searches using online Confluence Search feature using "{myMacro}" and been successful at returning content using a macro.  In particular, I have done searches based on "{HTMLComment}Standard Comment I embed in Certain Types of Pages{HTMLComment}" and "{include:Name of Reused Document}" to help manage re-used content. I believe this page may be a bit out of date for version 3.0.1.  To do this, I simply escaped the curly brases with the slash character.

    FYI - some of us work for corporations whose security policies prevent us from having sequel access to systems we administrate, so solutions that can be implimented based solely on built-in features are preferred.