<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Lookup update field value question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641928#M222372</link>
    <description>&lt;P&gt;Thanks, I figured i was overthinking it all&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 22:50:31 GMT</pubDate>
    <dc:creator>Dallastek1</dc:creator>
    <dc:date>2023-05-01T22:50:31Z</dc:date>
    <item>
      <title>How can I lookup update field value question?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641854#M222346</link>
      <description>&lt;P&gt;I have sanitized the index names-&lt;BR /&gt;I have users that have propagated a lookup command in dashboards that is now a major issue with the lookup file being so large now its causing bundle replication errors (lookup table is a whopping 512mb). They do not have an append=true in their dashboards and personally in my opinion its bad practice to create a lookup table using a dashboard but to use a scheduled search instead and reference in the dashboard.&lt;/P&gt;
&lt;P&gt;Id like a few sets of eyes on this and do a sanity check or am i looking at this totally wrong?&lt;/P&gt;
&lt;P&gt;BTW do i need commas to separate the field value's?&lt;/P&gt;
&lt;P&gt;The user want just certain values updated when run every 15 mins - "&amp;nbsp;&lt;SPAN&gt;pcenter office externalIP"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Their lookup command within the dashboard -&amp;nbsp;&lt;SPAN&gt;| lookup agentsessions.csv sessionId OUTPUTNEW pcenter office externalIP&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Now, my theory is they wanted to update&amp;nbsp; just the data in the fields for&amp;nbsp;&lt;SPAN&gt;pcenter, office, and&amp;nbsp; externalIP.&lt;BR /&gt;&lt;BR /&gt;IIRC the OUTPUTNEW command is used to fill a field that previously had no data (was blank)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The OUTPUT command IIRC replaces the specified data with the new data so the new dashboard command should look like this :&amp;nbsp;&amp;nbsp;&amp;nbsp;| lookup agentsessions.csv sessionId OUTPUT pcenter office externalIP.&lt;BR /&gt;&lt;BR /&gt;I created a scheduled search which should update the whole table (renamed it for testing)&lt;BR /&gt;index IN (one, two, three, four) source="wineventlog:custom SourceName=DesktopAgentService action timestamp sessionId Heartbeat&lt;BR /&gt;| table Message&lt;BR /&gt;| spath input=Message&lt;BR /&gt;| dedup sessionId sortby +_time&lt;BR /&gt;| lookup agentsessions2.csv sessionId OUTPUT sessionId as existingSessionId&lt;BR /&gt;| where isnull(existingSessionId)&lt;BR /&gt;| fields - action existingSessionId Message&lt;BR /&gt;| outputlookup agentsessions2.csv append=true&lt;BR /&gt;&lt;BR /&gt;OR I clould modifiy the scheduled search like this:&lt;BR /&gt;index IN (one, two, three, four) source="wineventlog:custom" SourceName=DesktopAgentService action timestamp sessionId Heartbeat&lt;BR /&gt;| table Message&lt;BR /&gt;| spath input=Message&lt;BR /&gt;| dedup sessionId sortby +_time&lt;BR /&gt;| lookup agentsessions2.csv sessionId OUTPUT sessionId as existingSessionId&amp;nbsp;pcenter office externalIP&lt;BR /&gt;| where isnull(existingSessionId)&lt;BR /&gt;| fields - action existingSessionId Message&lt;BR /&gt;| outputlookup agentsessions2.csv append=true&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, with the append=true, wont that duplicate entries each time it is ran? or will it just update the table with new fresh data?&lt;BR /&gt;Ran both my scheduled searches and they do seem to work, I just want to verify I am doing it correctly and getting&amp;nbsp;the updated data instead of them trying to do all this in a dashboard that runs every 15 mins. Or should I have them create a dataset table to do all this more efficiently? &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutdatasets" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/Knowledge/Aboutdatasets&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641854#M222346</guid>
      <dc:creator>Dallastek1</dc:creator>
      <dc:date>2023-05-02T13:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup update field value question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641856#M222347</link>
      <description>&lt;P&gt;The 'append=true' along with the 'outputlookup' command will overwrite the data in the file.If you wish to keep the old data and append the new results , then something like the below might be more feasible.&lt;/P&gt;&lt;PRE&gt;.. | inputlookup append=true &lt;SPAN&gt;a&lt;/SPAN&gt;gentsessions2.csv&lt;BR /&gt;| &lt;SPAN&gt;outputlookup a&lt;/SPAN&gt;gentsessions2.csv&lt;/PRE&gt;&lt;P&gt;But if the goal is to fetch new data and overwrite the CSV file , then it is ok.&lt;/P&gt;&lt;P&gt;For duplicates, we can just add a dedup command before 'outputlookup'.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 06:30:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641856#M222347</guid>
      <dc:creator>vinoth_raj</dc:creator>
      <dc:date>2023-05-01T06:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup update field value question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641928#M222372</link>
      <description>&lt;P&gt;Thanks, I figured i was overthinking it all&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 22:50:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-lookup-update-field-value-question/m-p/641928#M222372</guid>
      <dc:creator>Dallastek1</dc:creator>
      <dc:date>2023-05-01T22:50:31Z</dc:date>
    </item>
  </channel>
</rss>

