Confluence 4.0 : How to Search Confluence for Uses of a Macro
This page last changed on Aug 04, 2011 by twong.
Illegal Search TermsSeveral 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 DatabaseIf, for example you want to search for the uses of the
SELECT * FROM BODYCONTENT WHERE BODY LIKE '%{usage}%' If you want to get the last users or the creators of the pages where the SELECT CREATOR FROM CONTENT WHERE CONTENTID IN (SELECT CONTENTID FROM BODYCONTENT WHERE BODY LIKE '%{noformat}%') GROUP BY CREATOR SELECT LASTMODIFIER FROM CONTENT WHERE CONTENTID IN (SELECT CONTENTID FROM BODYCONTENT WHERE BODY LIKE '%{noformat}%') GROUP BY LASTMODIFIER Listing the occurences of the excerpt include macro (MYSQL only) select c.contentid, c.title, c.lastmoddate, c.lastmodifier, s.spacename from bodycontent bc join content c on bc.contentid=c.contentid join spaces s on s.spaceid = c.spaceid where c.contenttype='PAGE' and prevver is null and bc.body regexp '.*\{(excerpt-)?include*\}.*'; Logging Uses of a MacroThis 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 LogsYou can then grep the logs like: grep -c "{usage" atlassian-confluence.log |
![]() |
Document generated by Confluence on Sep 19, 2011 02:50 |