<?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: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395511#M114833</link>
    <description>&lt;P&gt;@raj_mpl , for incomplete transaction as mentioned in the comment , &lt;/P&gt;

&lt;P&gt;try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |transaction  id,host  startswith="started" endswith="completed" keepevicted=true
 |where closed_txn=0|eval runTime=round((now()-_time)/3600,2)
|where runTime&amp;gt;2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Jan 2019 10:41:58 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-01-11T10:41:58Z</dc:date>
    <item>
      <title>How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395499#M114821</link>
      <description>&lt;P&gt;Hi All, &lt;/P&gt;

&lt;P&gt;I am trying to populate a custom field value if my search time extracted field is not present in the raw log by using the below two methods . Here &lt;STRONG&gt;refield&lt;/STRONG&gt; is my search time extracted field&lt;/P&gt;

&lt;P&gt;1)&lt;CODE&gt;mysearch | eval Myfield=if(isnotnull(refield),refield,Custom_field)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;2)&lt;CODE&gt;|eval Myfield=coalesce(refield,Custom_field)&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;But, in the output, I am getting the result in Myfield as values of both refield and Custom_field .&lt;/P&gt;

&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 05:28:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395499#M114821</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-10T05:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395500#M114822</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/90549"&gt;@raj_mpl&lt;/a&gt; ,&lt;BR /&gt;
&lt;CODE&gt;Myfield=coalesce(refield,Custom_field)&lt;/CODE&gt; should give you the first non-null value. What you mean by both values are assigned to Myfield ? Is it a list or concatenated?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395500#M114822</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-29T22:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395501#M114823</link>
      <description>&lt;P&gt;Hi @renjith.nair , Thanks for your reply on this &lt;BR /&gt;
Yes I am getting the two results by concatenation in a separate line for Myfield &lt;/P&gt;

&lt;P&gt;Myfield&lt;BR /&gt;
Value1 (regex extracted  string  (captured group))&lt;BR /&gt;
Value2( Custom_field value)&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 07:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395501#M114823</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-10T07:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395502#M114824</link>
      <description>&lt;P&gt;Do you mind sharing your search ? &lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 08:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395502#M114824</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-10T08:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395503#M114825</link>
      <description>&lt;P&gt;Sure , Below is my search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=myindex |rex field=_raw "(?ms)TEXT\.\s+(?P&amp;lt;refield&amp;gt;.+?)at\s(web|org)\."|eval Custom_field=”check the log”| eval  Error_Description=if(isnotnull(refield),refield,Custom_field)|transaction  id,host  startswith="started" endswith="completed" |table  id host Error_Description
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And also tried |eval Error_description=coalesce(refield,Custom_field)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:41:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395503#M114825</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2020-09-29T22:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395504#M114826</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/90549"&gt;@raj_mpl&lt;/a&gt; , &lt;BR /&gt;
Thats because your one transaction has more than one values for &lt;CODE&gt;Error_Description&lt;/CODE&gt;. You can verify by removing the table command and look at the events directly&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395504#M114826</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-29T22:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395505#M114827</link>
      <description>&lt;P&gt;Hi @renjith.nair .., Yes my regex will extract the field value for &lt;STRONG&gt;Error_Description&lt;/STRONG&gt; at search time , My requirement is if the regex provided will not able to pick anything as per the condition , I have to populate an new field &lt;/P&gt;

&lt;P&gt;But what actually happening is The &lt;STRONG&gt;Error_Descriptin&lt;/STRONG&gt; field is having field &lt;STRONG&gt;a&lt;/STRONG&gt; value also in it as you said 2 values &lt;/P&gt;

&lt;P&gt;Then what is the resolution for this?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 13:03:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395505#M114827</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-10T13:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395506#M114828</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/90549"&gt;@raj_mpl&lt;/a&gt; ,since the transaction doesn't depend on the Error_Description , do the &lt;CODE&gt;coalesce&lt;/CODE&gt; after the transaction and before the table command or just &lt;CODE&gt;fillnull value="check the log"  Error_Description&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395506#M114828</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-29T22:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395507#M114829</link>
      <description>&lt;P&gt;Thank you @renjith.nair , I just changed the placement of the &lt;STRONG&gt;Error_Description&lt;/STRONG&gt; filed &lt;BR /&gt;
And it worked perfectly . &lt;/P&gt;

&lt;P&gt;On an other note can you give some ideas to me to find the Long running jobs using transaction command.&lt;BR /&gt;
I want to create an alert for long running transactions .&lt;BR /&gt;
Consider events will start with "start" and completes with "closed" string. In this with a Customer_Id common in them . &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Note : My focus is not on completed transactions , I have to identify the ongoing jobs which are running from past 2 hours and not closed yet (still running) .&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Thank you .&lt;BR /&gt;
Rajesh&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 09:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395507#M114829</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-11T09:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395508#M114830</link>
      <description>&lt;P&gt;@raj_mpl ,alright. I will move the comment to the answer section.&lt;BR /&gt;
For your next question, is the customer id unique for each transaction ? and if not how do you identify the transactions - especially if another transaction starts and end before the first transaction (overlapping) ? If there is a uniq id for each transaction/job, we might be able to find it without using a &lt;CODE&gt;transaction&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:24:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395508#M114830</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-11T10:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395509#M114831</link>
      <description>&lt;P&gt;@raj_mpl ,&lt;/P&gt;

&lt;P&gt;The duplicated values are because of transaction command which brings together all the values matches the transaction. &lt;/P&gt;

&lt;P&gt;Since  since the transaction doesn't depend on the &lt;CODE&gt;Error_Description&lt;/CODE&gt; , do the &lt;CODE&gt;coalesce&lt;/CODE&gt; after the transaction and before the &lt;CODE&gt;table&lt;/CODE&gt; command or just &lt;CODE&gt;fillnull value="check the log"  Error_Description&lt;/CODE&gt; at the end of the search&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=myindex |rex field=_raw "(?ms)TEXT\.\s+(?P&amp;lt;refield&amp;gt;.+?)at\s(web|org)\."|eval Custom_field=”check the log”
  |transaction  id,host  startswith="started" endswith="completed"
  |eval  Error_Description=coalesce(refield,Custom_field)
  |table  id host Error_Description
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395509#M114831</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-11T10:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395510#M114832</link>
      <description>&lt;P&gt;Thank you @renjith.nair . I just changed the placement of the Error_Description filed &lt;BR /&gt;
And it worked perfectly . Thank you &lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395510#M114832</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-11T10:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395511#M114833</link>
      <description>&lt;P&gt;@raj_mpl , for incomplete transaction as mentioned in the comment , &lt;/P&gt;

&lt;P&gt;try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |transaction  id,host  startswith="started" endswith="completed" keepevicted=true
 |where closed_txn=0|eval runTime=round((now()-_time)/3600,2)
|where runTime&amp;gt;2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:41:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395511#M114833</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-11T10:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395512#M114834</link>
      <description>&lt;P&gt;Hi @renjith.nair , Yes the &lt;STRONG&gt;Job name&lt;/STRONG&gt;(customer ID) and the &lt;STRONG&gt;id&lt;/STRONG&gt; is unique for each transaction &lt;BR /&gt;
&lt;STRONG&gt;Below is the Query I am using for still running Jobs .&lt;/STRONG&gt; &lt;BR /&gt;
index=myindex  "] Agent" "load plan instance"  | rex field=_raw "instance\s(?[^)]+)\s((?[^)]+)"  |transaction  Job_Name,id  startswith="started plan instance" endswith="successfully completed Plan" keepevicted=true | where closed_txn=0 | search NOT stopped  | table  _time, Job_Name, userid&lt;/P&gt;

&lt;P&gt;My requirement is to get an alert for the transaction which is still in progress (from past 2hours) , I will schedule the alert to run every 20 min using cron notation&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:44:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395512#M114834</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2020-09-29T22:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395513#M114835</link>
      <description>&lt;P&gt;You can reply me in the thread &lt;STRONG&gt;Can you help me create an alert involving the transaction command&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 11:06:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395513#M114835</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-11T11:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do you populate a field if the search time extracted field (using regular expression) is not presented in the logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395514#M114836</link>
      <description>&lt;P&gt;Can you please explain a bit , What actually it will perform ?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 11:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-populate-a-field-if-the-search-time-extracted-field/m-p/395514#M114836</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-01-11T11:33:22Z</dc:date>
    </item>
  </channel>
</rss>

