<?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: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448047#M174097</link>
    <description>&lt;P&gt;Here is the sample logs&lt;/P&gt;

&lt;P&gt;12/15/18&lt;BR /&gt;
8:25:13.860 PM&lt;BR /&gt;&lt;BR /&gt;
"12-15 20:25:13,860  INFO - logs/app/fmapp1 12-15,20:24:52.019 ios11 1-423 0 4 DDC3-2 connected XXX:XXX".&lt;BR /&gt;
Field2 = INFO Field4 = 1-423 0 4 Log_Time = 12-15 20:25:13,860 detailed_logs =  4 DDC3-2 connected XXX:XXX . host = servername source = /applog/log.txt sourcetype =    prd_asg_app_logs&lt;/P&gt;

&lt;P&gt;12/15/18&lt;BR /&gt;
8:22:55.671 PM&lt;BR /&gt;&lt;BR /&gt;
"12-15 20:22:55,671 ERROR - logs/app/fmapp1 12-15,20:22:32.734 ios55 1-426 0 2 DDC1-4 connect fail XXX:XXX Connection refused (Connection refused)"&lt;BR /&gt;
Field2 =ERROR Field4 =  1-426 0 2 Log_Time =    12-15 20:22:55,671 detailed_logs =  DDC1-4 connect fail XXX:XXX Connection refused (Connection refused) host = servername source =/applogs/log.txt sourcetype = prd_asg_app_logs &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:29:06 GMT</pubDate>
    <dc:creator>a508184</dc:creator>
    <dc:date>2020-09-29T22:29:06Z</dc:date>
    <item>
      <title>I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448043#M174093</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;

&lt;P&gt;Need to create a Splunk dashboard for an application. &lt;/P&gt;

&lt;P&gt;Am very new to Splunk and doesn't have any Splunk experts within my organization, so need your help.&lt;/P&gt;

&lt;P&gt;Sample log format:&lt;BR /&gt;
12-15 20:22:55,671 ERROR - logs/app/applog 1-426 DC1-4 connect fail host:port Connection refused (Connection refused)&lt;BR /&gt;
12-15 20:25:13,860  INFO - logs/app/applog 1-423 DC1-4 connected host:port&lt;/P&gt;

&lt;P&gt;Time = 12-15 20:25:13&lt;BR /&gt;
Status = INFO&lt;BR /&gt;
Log Path = logs/app/applog &lt;BR /&gt;
Stats Status = 1-426&lt;BR /&gt;
Process = DC1-4 and DC1-4&lt;/P&gt;

&lt;P&gt;Whenever apps is having issues connecting to other sources, it throws an error message with the stats status 1-426 for the particular process DC1-4. Once its fixed then INFO (Success) message will be printed in the logs with the stats status - 1-423 for the particular process DC1-4.&lt;/P&gt;

&lt;P&gt;Requirement:&lt;BR /&gt;
 - I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 11:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448043#M174093</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2018-12-16T11:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448044#M174094</link>
      <description>&lt;P&gt;@a508184,&lt;/P&gt;

&lt;P&gt;We need to extract the Status field and Process field from the log and show only if the latest status is down(1-426)&lt;/P&gt;

&lt;P&gt;Based on your sample event, below regex can be used. Please let us know if there is a change in the format of Status or Process string&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="your index" "other search terms"
| rex field=_raw "applog (?&amp;lt;Status&amp;gt;\d-\d{3}) (?&amp;lt;Process&amp;gt;\w+-\w+)"
| stats latest(Status) as Status , latest(_raw) as _raw by Process|where Status="1-426"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may adjust the regex according to your actual events.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 12:16:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448044#M174094</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-16T12:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448045#M174095</link>
      <description>&lt;P&gt;Hi Renjith - &lt;/P&gt;

&lt;P&gt;Thanks for your reply. Yes i can't exact the process, because log format differs for different process ID's. &lt;/P&gt;

&lt;P&gt;Also, i need to display the error in the Dashboard until its fixed or success STATS status code (1-423).&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Nithin Setty&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 13:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448045#M174095</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2018-12-16T13:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448046#M174096</link>
      <description>&lt;P&gt;Hi Nithin,&lt;/P&gt;

&lt;P&gt;Is it possible to provide sample events (anonymize sensitive data) for those different events? We might be able to provide a general extraction.&lt;BR /&gt;
The error will be displayed until the STATUS code is 1-423 because we are filtering the events only for FAILURES by using &lt;CODE&gt;|where Status="1-426"&lt;/CODE&gt;. &lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 13:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448046#M174096</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-16T13:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448047#M174097</link>
      <description>&lt;P&gt;Here is the sample logs&lt;/P&gt;

&lt;P&gt;12/15/18&lt;BR /&gt;
8:25:13.860 PM&lt;BR /&gt;&lt;BR /&gt;
"12-15 20:25:13,860  INFO - logs/app/fmapp1 12-15,20:24:52.019 ios11 1-423 0 4 DDC3-2 connected XXX:XXX".&lt;BR /&gt;
Field2 = INFO Field4 = 1-423 0 4 Log_Time = 12-15 20:25:13,860 detailed_logs =  4 DDC3-2 connected XXX:XXX . host = servername source = /applog/log.txt sourcetype =    prd_asg_app_logs&lt;/P&gt;

&lt;P&gt;12/15/18&lt;BR /&gt;
8:22:55.671 PM&lt;BR /&gt;&lt;BR /&gt;
"12-15 20:22:55,671 ERROR - logs/app/fmapp1 12-15,20:22:32.734 ios55 1-426 0 2 DDC1-4 connect fail XXX:XXX Connection refused (Connection refused)"&lt;BR /&gt;
Field2 =ERROR Field4 =  1-426 0 2 Log_Time =    12-15 20:22:55,671 detailed_logs =  DDC1-4 connect fail XXX:XXX Connection refused (Connection refused) host = servername source =/applogs/log.txt sourcetype = prd_asg_app_logs &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:29:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448047#M174097</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2020-09-29T22:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448048#M174098</link>
      <description>&lt;P&gt;Below is different senario, &lt;/P&gt;

&lt;P&gt;Here for error its 6-908 stats status code will be returned for the f1/DC1/PRD03 counters.&lt;BR /&gt;
12-15 17:25:02,318 ERROR - logs/stats/stats1 12-15,17:25:01.397 ios13 6-908 0 2 Stats create alert DDlag2 f1/DC1/PRD03  value 1544916240000&lt;BR /&gt;
Counters =  f1/DC1/PRD03 Field2 =   ERROR Field4 =  6-908 0 2 Log_Time =    12-15 17:25:02,318 detailed_logs =  Stats create alert DDlag2 applog/PRD03 value 1544916240000 host =   &lt;SERVERNAME&gt; source =   /applogs/log.txt sourcetype =   prd_asg_app_logs&lt;/SERVERNAME&gt;&lt;/P&gt;

&lt;P&gt;Success stats status code is 6-904 for the f1/DC1/PRD03 counters.&lt;BR /&gt;
12-15 21:29:05,289  INFO - logs/stats/stats1 12-15,21:29:00.214 ios13 6-904 0 4 Stats clear alert DDlag2 f1/DC1/PRD03  value 8270&lt;BR /&gt;
Counters =  f1/DC1/PRD03 Field2 =   INFO Field4 =   6-904 0 4 Log_Time =    12-15 21:29:05,289 detailed_logs =  4 Stats clear alert DDlag2 f1/DC1/PRD03 value 8270 host =   &lt;SERVERNAME&gt; source =   /applogs/log.txt sourcetype =   prd_asg_app_logs&lt;/SERVERNAME&gt;&lt;/P&gt;

&lt;P&gt;Above and below senario needs to be incudle in the same dashboard.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448048#M174098</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2020-09-29T22:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448049#M174099</link>
      <description>&lt;P&gt;@a508184, What are these Counters ,Field2, Field4 etc? Are these extracted fields ? If thats the case, your status is already in Field4 . And counters has the process information. Then we just need to combine these two scenario.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 03:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448049#M174099</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-17T03:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448050#M174100</link>
      <description>&lt;P&gt;Yeah - they are extracted fields, however the below query is working for me for two different scenarios. &lt;BR /&gt;
index=asg sourcetype=prd_asg_app_logs source=* &lt;BR /&gt;
|rex field=_raw " (?\d-\d{3})" | rex field=_raw " (?DDC\w+-\w+)" &lt;BR /&gt;
| stats last(Status) as Status , last(_raw) as _raw by Process, source&lt;BR /&gt;
|where Status="6-908"&lt;/P&gt;

&lt;P&gt;index=asg sourcetype=prd_asg_app_logs source=* NOT ("fmq" "dbWriter*")&lt;BR /&gt;
|rex field=_raw " (?\d-\d{3})" |rex field=_raw "fmapp1/(?D\w+/\w+)" &lt;BR /&gt;
|table Process Status source _raw&lt;BR /&gt;
|where Status="6-908"  |where isnotnull(Process)&lt;/P&gt;

&lt;P&gt;Could you please help in combining both the queries?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Nithin Setty&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:29:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448050#M174100</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2020-09-29T22:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448051#M174101</link>
      <description>&lt;P&gt;Try this. You may adjust the rex and conditions based on your actual events,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=asg sourcetype=prd_asg_app_logs source=* 
|rex field=_raw "(?&amp;lt;Status&amp;gt;\d-\d{3})"
|rex field=_raw "(?&amp;lt;Process1&amp;gt;DDC\w+-\w+)"
|rex field=_raw "fmapp1/(?&amp;lt;Process2&amp;gt;D\w+/\w+)"
|eval Process=if(source!="fmq" OR source!="dbWriter",Process2,Process1)
|table Process Status source _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Dec 2018 09:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448051#M174101</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-17T09:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448052#M174102</link>
      <description>&lt;P&gt;Thanks a lot for your help Renjith.&lt;/P&gt;

&lt;P&gt;It works, but i cant achieve the below scenario&lt;/P&gt;

&lt;P&gt;I need to display the error in the Dashboard until its fixed or success STATS status code 1-423 for first query and 6-904 for the second query.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;First Query - Success Code 1-423 and Error Code 1-426&lt;/STRONG&gt;&lt;BR /&gt;
index=asg sourcetype=prd_asg_app_logs source=* &lt;BR /&gt;
 |rex field=_raw "(?\d-\d{3})"&lt;BR /&gt;
 |rex field=_raw "(?DDC\w+-\w+)"&lt;BR /&gt;
 |stats latest(Status) as Status , latest(_raw) as _raw by Process&lt;BR /&gt;
 |where Status="1-426"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;First Query - Success Code 6-904 and Error Code 6-908&lt;/STRONG&gt;&lt;BR /&gt;
index=asg sourcetype=prd_asg_app_logs source=*&lt;BR /&gt;
|rex field=_raw " (?\d-\d{3})" |rex field=_raw "fmapp1/(?\w+/\w+)" &lt;BR /&gt;
| stats latest(Status) as Status , latest(_raw) as _raw by Process &lt;BR /&gt;
|where Status="6-908" |where isnotnull(Process)&lt;/P&gt;

&lt;P&gt;Need your help in combining both the queries which matches scenario.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:29:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448052#M174102</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2020-09-29T22:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448053#M174103</link>
      <description>&lt;P&gt;@a508184, since the above combined search is working for  you, we add these conditions too the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=asg sourcetype=prd_asg_app_logs source=* 
 |rex field=_raw "(?&amp;lt;Status&amp;gt;\d-\d{3})"
 |rex field=_raw "(?&amp;lt;Process1&amp;gt;DDC\w+-\w+)"
 |rex field=_raw "fmapp1/(?&amp;lt;Process2&amp;gt;D\w+/\w+)"
 |eval Process=if(source!="fmq" OR source!="dbWriter",Process2,Process1)
 |stats latest(Status) as Status,latest(_raw) as Message by Process
 |where (Status!="1-426" AND Status!="6-904")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:51:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448053#M174103</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-18T13:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: I need to display the error message (DC1-4 connect fail host:port Connection refused (Connection refused)) in a column until logs have the info message (DC1-4 connected host:port)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448054#M174104</link>
      <description>&lt;P&gt;Thanks Renjith for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 08:21:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-need-to-display-the-error-message-DC1-4-connect-fail-host-port/m-p/448054#M174104</guid>
      <dc:creator>a508184</dc:creator>
      <dc:date>2018-12-24T08:21:20Z</dc:date>
    </item>
  </channel>
</rss>

