User Tools

Site Tools


alarm_analysis:meta_tags

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
alarm_analysis:meta_tags [2023/06/21 10:31] sualarm_analysis:meta_tags [2023/06/21 13:46] – [How to add a "Meta Tag" to an Alarm Analysis Tag Index] su
Line 26: Line 26:
 To administer an Alarm Analysis Tag Index, you must log on the App Store Connect server hosting the Alarm Analysis data source. The instructions below are useful Powershell command. To administer an Alarm Analysis Tag Index, you must log on the App Store Connect server hosting the Alarm Analysis data source. The instructions below are useful Powershell command.
  
-**1. Identifiy Alarm Analysis Tag Indices**+**1. Identifiy Alarm Analysis tag indices**
  
   ### Get all AA Tag Indices   ### Get all AA Tag Indices
Line 39: Line 39:
    e.g. "oilco.osprey.tagidx"    e.g. "oilco.osprey.tagidx"
  
-**2. Query a Tag Index** +**2. Find a meta-tag in the tag index**
- +
-  ### Find tag in tag index+
  
 +  ### Find tag
 +  
   $body='{   $body='{
       "query":{       "query":{
           "term":{           "term":{
-              "id":"Oil Co/Osprey/Export Gas/Alarm State"+              "id":"Oil Co/Osprey/ALM BA report/3.priority"
           }           }
       }       }
Line 54: Line 54:
     -ContentType 'application/json' `     -ContentType 'application/json' `
     -Method Post `     -Method Post `
-    -Body '{"query":{"term":{"id":"Oil Co/Osprey/Export Gas/Alarm State"}}}' `+    -Body $body `
     | ConvertTo-Json -Depth 20     | ConvertTo-Json -Depth 20
          
-The above query is checking the "oilco.osprey.tagidx" for meta-tag "Oil Co/Osprey/Export Gas/Alarm State".+The above query is checking the "oilco.osprey.tagidx" for meta-tag "Oil Co/Osprey/ALM BA report/3.priority".
  
-**3. Add an entry to a Tag Index**+**3. Add an meta-tag to a tag index**
  
-If a tag doesn't already exist, it is safe to create it.+Only add meta-tag to the tag-index, if...
  
-  ### Add tag to tag index+  * It does not already exist - //check using the find-tag script above.// 
 +  * You have a valid meta-tag name - //check against the meta-tag list.//
  
 +
 +  ### Create tag 
 +  
   $body='{   $body='{
-      "query":{ +    "id": "Oil Co/Osprey/ALM BA report/3.priority", 
-          "term":{ +    "fullName": "Oil Co/Osprey/ALM BA report/3.priority", 
-              "id":"Oil Co/Osprey/Export Gas/Alarm State+    "name": "Oil Co/Osprey/ALM BA report/3.priority", 
-          } +    "tag": "", 
-      }+    "alarmIdentifier": "", 
 +    "type": "", 
 +    "description": "Bad Actor Priority", 
 +    "eventTagType": "kpi", 
 +    "uom": "", 
 +    "lastUpdateUtc": "2023-06-21T10:52:56.2978113Z"
   }'   }'
- +   
-  Invoke-RestMethod -Uri http://localhost:9200/oilco.osprey.tagidx/_search `+  Invoke-RestMethod -Uri http://localhost:9200/oilco.osprey.tagidx/eventtag/ `
     -ContentType 'application/json' `     -ContentType 'application/json' `
     -Method Post `     -Method Post `
-    -Body '{"query":{"term":{"id":"Oil Co/Osprey/Export Gas/Alarm State"}}}' `+    -Body $body `
     | ConvertTo-Json -Depth 20     | ConvertTo-Json -Depth 20
 +    
 +**4. Delete a meta-tag from the tag index**
  
-**4Remove an entry to a Tag Index**+Every tag in the tag index has a unique "_id" field (e.g. "AYjeEdp6nSbnh-NXfE0C"). This must be specified in the delete request. 
 +   
 +Use the search query above to obtain the "_id".
  
 +  ### Delete tag
 +  
 +  Invoke-RestMethod -Uri http://localhost:9200/oilco.osprey.tagidx/eventtag/AYjeEdp6nSbnh-NXfE0C `
 +    -ContentType 'application/json' `
 +    -Method Delete `
 +    | ConvertTo-Json -Depth 20
 +  
  
    
alarm_analysis/meta_tags.txt · Last modified: 2024/01/31 14:23 by su