Thank you.. your suggestion makes good sense and I was never particuarly keen on have to hard set a number for the search results...
However, the initial search has moved on a bit as I found the data was not giving me what i was after so now have a search with a whole lot of xpath commands (to get the data I need from the xml).
index=aalalive "Policy Number allocated for Quote" | rex "O [^A-Z]*(?<ENV>[A-Z\-\d+\s]+) \[" | search ENV="PRD*" | eval PRODUCT=substr(Quote_Number, len(Quote_Number)-2,3) | search PRODUCT=COM | map search="search index=stps NEVO policyNumber=$Policy_Number$" maxsearches=10000 |
xpath outfield=Net_Premium "//*[local-name()='AALNet' and *[local-name()='AnnualAmount']]/*[local-name()='EndOfTermAmount']" |
xpath outfield=Net_Returned_Premium "//*[local-name()='AALNet' and *[local-name()='AnnualAmount']]/*[local-name()='ComparisonAmount']" |
xpath outfield=Gross_Premium "//*[local-name()='Gross' and *[local-name()='FortnightlyAmount']]/*[local-name()='EndOfTermAmount']" |
xpath outfield=Gross_Returned_Premium "//*[local-name()='Gross' and *[local-name()='FortnightlyAmount']]/*[local-name()='ComparisonAmount']" |
xpath outfield=Stage "//*[local-name()='TransactionInformation']/*[local-name()='ContractStage']" |
xpath outfield=Status "//*[local-name()='TransactionInformation']/*[local-name()='ContractStatus']" |
xpath outfield=Account "//*[local-name()='OrganisationName' and *[local-name()='TypeCode']]/*[local-name()='FullName']" |
where Status="Closed" |
eval Gross_Premium=if(match(Gross_Returned_Premium , "0.00") , Gross_Premium , Gross_Returned_Premium) |
eval Net_Premium=if(match(Net_Returned_Premium ,"0.00") , Net_Premium , Net_Returned_Premium) |
fieldformat Gross_Premium = "$" + tostring(Gross_Premium, "commas") |
fieldformat Net_Premium = "$" + tostring(Net_Premium, "commas") |
table Account policyNumber Stage Status Gross_Premium Net_Premium
I have tried to play around with your example above but cannot figure out where to insert the xpath commands so that the search returns results - each time I run it it simply returns 'No Results'
Any pointers will be a great help..
A million thanks as always
Alastair
... View more