tl:dr - questions I am looking to get answers for: 1. Is there a better way to do this? 2. Is it possible to dynamically declare and store the _key values that I want to update? --------------------------------------------------- I have a KV Store that holds statefulness data from a program that runs over 300 different tests. The KV Store presently string fields with data that I filled from a previous query with the last_status field set as the string "stub" while I'm working on getting it functional. The field names in the kvstore are: last_time last_status test_name rule_name test_target and of course the hidden _key field. I'm trying to update the last_time and last_status when the conditions are suitable. The suitable condition is when the test, rule, and target fields match a subsearch with the same values in their respective fields. I'm having issues with getting the KV Store to update. I've seen the following approaches suggested already from the questions I could find and the kb type articles. | inputlookup csvcoll_lookup | search _key=544948df3ec32d7a4c1d9755 | eval CustName="Marge Simpson" | eval CustCity="Springfield" | outputlookup csvcoll_lookup append=True Which led me to finding a suggestion of | inputlookup csvcoll_lookup | where _key IN("544948df3ec32d7a4c1d9755","544948df3ec32d7a4c1d9756","544948df3ec32d7a4c1d9757") | eval CustName="Marge Simpson" | eval CustCity="Springfield" | outputlookup csvcoll_lookup append=True I have something similar to the following query (some vars and objects have have their names changed to some degree, but still represent the logic I'm trying to work with. | inputlookup kvstoreA
| eval
last_time=strftime(last_time,"%Y-%m-%dT%H:%M:%S"),
key=_key,
joinField=test_name+rule_name+test_target
| join type=inner [
search index=a sourcetype=b NOT variable="ignore"
| dedup testName testTargetDesc ruleName
| eval
Event_last_time=strftime(last_time,"%Y-%m-%dT%H:%M:%S"),
Event_last_status=case(eventType=="A","healthy",eventType=="B","unhealthy",TRUE(),"undefined"),
Event_test_name='alert.testName',
Event_rule_name='alert.ruleName',
Event_test_target='alert.testTargetsDescription{}',
joinField=Event_test_name+Event_rule_name+Event_test_target]
| where Event_last_time!=last_time
| eval
last_status=Event_last_status,
last_time=Event_last_time
| fields last_time last_status test_name rule_name test_target view_key
| outputlookup kvstoreA key_field=view_key append=True From what I have read and tested so far I am sure that I don't know how to extract the _key values in a dynamic way that can be applied to update specific entries in the table. 1. Is there a better way to do this? 2. Is it possible to dynamically declare and store the _key values that I want to update?
... View more