Hi Experts,
I have an APP which contains more than 170 reports and searches. Need to edit the email address for all searches and reports. Is there any way to edit it for all reports in a single shot instead of editing one by one?
Thanks
You can do this with the sendemail search command and macros. Macro references are replaced before the search executes and thus changing the macro will change all of the searches that use the macro.
Here are steps to use it:
Step 1: create a macro that defines the email addresses
Create a macro that contains the email addresses. You can do this in the manager under Settings » Advanced search » Search macros » New.
Your macro might look something like this in the file-system:
[email_addresses]
definition = nouser@fakemail.com
iseval = 0
Step 2: use the macro with sendemail in your searches
Modify your search to use sendemail along with the macro. Below is an example:
* | head 1 | sendemail `email_addresses`
In this example, the macro will expand to:
* | head 1 | sendemail nouser@fakemail.com
If you're on a *nix machine, you can use some command line fu and sed to do this:
sed --in-place 's/old@example.com/new@example.com/' savedsearches.conf
If you're on Windows, from PowerShell
(Get-Content .\savedsearches.conf) -replace "old@example.com", "new@example.com" | Set-Content .\savedsearches.conf
thanks joxley....
we have lot of savedsearches.conf. Can you please provide the exact path for the same?
You can do this with the sendemail search command and macros. Macro references are replaced before the search executes and thus changing the macro will change all of the searches that use the macro.
Here are steps to use it:
Step 1: create a macro that defines the email addresses
Create a macro that contains the email addresses. You can do this in the manager under Settings » Advanced search » Search macros » New.
Your macro might look something like this in the file-system:
[email_addresses]
definition = nouser@fakemail.com
iseval = 0
Step 2: use the macro with sendemail in your searches
Modify your search to use sendemail along with the macro. Below is an example:
* | head 1 | sendemail `email_addresses`
In this example, the macro will expand to:
* | head 1 | sendemail nouser@fakemail.com
Thank you:-)
NO NO NO !
Each scheduled search is independent to another. In such case you must edit each search, to add your email address
Thanks
Thank you 🙂
Edit the email address how? what is the relation between your reports and your email address?
We scheduled searches and some reports. And the results will be delivered to some recipients through email. Now i would like to include an email address for all the searches and reports. I dont want to edit each and every single report and add the email address.... this is the scenario.