<?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: expect value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470380#M192139</link>
    <description>&lt;P&gt;run your solution on this part of log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 09:04:01.042,module1,F[6]L,IN
 09:04:01.437,module1,F[6]L,OUT
 09:04:01.438,module4,F[6]L,IN
 09:04:01.439,module4,F[6]L,OUT
 09:04:01.481,module2,F[6]L,IN
 09:04:01.482,module2,F[6]L,IN
 09:04:01.483,module2,F[6]L,IN
 09:04:01.484,module2,F[6]L,OUT
 09:04:01.485,module2,F[6]L,OUT
 09:04:01.488,module50,F[18]L,IN
 09:04:01.489,module52,F[20]L,IN
 09:04:01.490,module53,F[18]L,OUT
 09:04:01.491,module52,F[20]L,OUT"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;result: &lt;BR /&gt;
 09:04:01.481,module2,F[6]L,IN&lt;BR /&gt;
 09:04:01.482,module2,F[6]L,IN&lt;BR /&gt;
 09:04:01.488,module50,F[18]L,IN&lt;/P&gt;

&lt;P&gt;expected result:&lt;BR /&gt;
 09:04:01.483,module2,F[6]L,IN&lt;BR /&gt;
 09:04:01.488,module50,F[18]L,IN&lt;BR /&gt;
 09:04:01.490,module53,F[18]L,OUT&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2019 10:09:35 GMT</pubDate>
    <dc:creator>indeed_2000</dc:creator>
    <dc:date>2019-12-30T10:09:35Z</dc:date>
    <item>
      <title>expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470374#M192133</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I have log file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;09:04:04.042 module1:  F[6]L: IN
09:04:01.417 module1:  F[6]L: OUT
09:04:01.418 module4:  F[6]L: IN
09:04:01.419 module4:  F[6]L: OUT
09:04:01.420 module12: F[6]L: IN
09:04:01.421 module2:  F[6]L: IN
09:04:01.422 module41: F[6]L: IN
09:04:01.426 module12: F[6]L: OUT
09:04:01.427 module50: F[18]L: IN
09:04:01.428 module52: F[20]L: IN
09:04:01.429 module50: F[18]L: OUT
09:04:01.435 module52: F[20]L: OUT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as you see every module had (IN) value after while (OUT).&lt;/P&gt;

&lt;P&gt;Now I want to define something to expect (OUT) value for each (IN) due to the Fingerprint and Module.&lt;BR /&gt;
For example in above log file:&lt;BR /&gt;
1- group them by F  (F value means fingerprint)&lt;BR /&gt;
2- group them by modules &lt;BR /&gt;
3- detect any F had (IN) but no (OUT). example module2, module41 with F[6] had IN (input) but never had OUT (output). &lt;/P&gt;

&lt;P&gt;Any recommendation?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 16:48:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470374#M192133</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-28T16:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470375#M192134</link>
      <description>&lt;P&gt;Hi @mehrdad_2000,&lt;BR /&gt;
you could run something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index
| rex "^\d+:\d+:\d+\.\d+\s+(?&amp;lt;module&amp;gt;[^:]*):\s+(?&amp;lt;fingerprint&amp;gt;[^:]*):\s+(?&amp;lt;value&amp;gt;\w+)"
| stats dc(value) AS dc_values values(value) AS value BY module fingerprint
| where dc_values&amp;lt;2 AND value="IN"
| table module fingerprint
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao and Happy New Year.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 16:58:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470375#M192134</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-28T16:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470376#M192135</link>
      <description>&lt;P&gt;Thank you and Happy New Year &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
this is large file I can't define dc value, it has lots of this kind of events.&lt;/P&gt;

&lt;P&gt;I expect every single value that hadn't output.&lt;/P&gt;

&lt;P&gt;Any idea?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 17:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470376#M192135</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-28T17:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470377#M192136</link>
      <description>&lt;P&gt;Hi @mehrdad_2000,&lt;BR /&gt;
if you have many events  it isn't a problem!&lt;BR /&gt;
if you could have more than 2 events for the same module and fingerprint, you have to use the transaction command that's a very slow command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=my_index
 | rex "^\d+:\d+:\d+\.\d+\s+(?&amp;lt;module&amp;gt;[^:]*):\s+(?&amp;lt;fingerprint&amp;gt;[^:]*):\s+(?&amp;lt;value&amp;gt;\w+)"
 | transaction module fingerprint startswith=": IN"
 | where eventcount&amp;lt;2
 | table module fingerprint
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao and Happy New Year.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 17:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470377#M192136</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-28T17:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470378#M192137</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="Time,module,fingerprint,direction
9:04:04.042,module1,F[6]L,IN
09:04:01.437,module1,F[6]L,OUT
09:04:01.427,module4,F[6]L,IN
09:04:01.422,module4,F[6]L,OUT
09:04:01.381,module12,F[6]L,IN
09:04:01.371,module2,F[6]L,IN
09:04:01.338,module41,F[6]L,IN
09:04:01.381,module12,F[6]L,OUT
09:04:01.338,module50,F[18]L,IN
09:04:01.381,module52,F[20]L,IN
09:04:01.338,module50,F[18]L,OUT
09:04:01.381,module52,F[20]L,OUT"
| multikv forceheader=1
| eval _time = strptime(Time, "%H:%M:%S.%3N")
| sort 0 - _time

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| stats dc(direction) AS dc values(direction) AS directions BY fingerprint module
| where dc&amp;lt;2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Dec 2019 23:19:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470378#M192137</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-28T23:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470379#M192138</link>
      <description>&lt;P&gt;Thank you @woodcock this is exactly what i want. &lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 13:42:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470379#M192138</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-29T13:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470380#M192139</link>
      <description>&lt;P&gt;run your solution on this part of log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; 09:04:01.042,module1,F[6]L,IN
 09:04:01.437,module1,F[6]L,OUT
 09:04:01.438,module4,F[6]L,IN
 09:04:01.439,module4,F[6]L,OUT
 09:04:01.481,module2,F[6]L,IN
 09:04:01.482,module2,F[6]L,IN
 09:04:01.483,module2,F[6]L,IN
 09:04:01.484,module2,F[6]L,OUT
 09:04:01.485,module2,F[6]L,OUT
 09:04:01.488,module50,F[18]L,IN
 09:04:01.489,module52,F[20]L,IN
 09:04:01.490,module53,F[18]L,OUT
 09:04:01.491,module52,F[20]L,OUT"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;result: &lt;BR /&gt;
 09:04:01.481,module2,F[6]L,IN&lt;BR /&gt;
 09:04:01.482,module2,F[6]L,IN&lt;BR /&gt;
 09:04:01.488,module50,F[18]L,IN&lt;/P&gt;

&lt;P&gt;expected result:&lt;BR /&gt;
 09:04:01.483,module2,F[6]L,IN&lt;BR /&gt;
 09:04:01.488,module50,F[18]L,IN&lt;BR /&gt;
 09:04:01.490,module53,F[18]L,OUT&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 10:09:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470380#M192139</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-30T10:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: expect value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470381#M192140</link>
      <description>&lt;P&gt;run your solution on this part of log:&lt;BR /&gt;
      09:04:01.042,module1,F[6]L,IN&lt;BR /&gt;
      09:04:01.437,module1,F[6]L,OUT&lt;BR /&gt;
      09:04:01.438,module4,F[6]L,IN&lt;BR /&gt;
      09:04:01.439,module4,F[6]L,OUT&lt;BR /&gt;
      09:04:01.481,module2,F[6]L,IN&lt;BR /&gt;
      09:04:01.482,module2,F[6]L,IN&lt;BR /&gt;
      09:04:01.483,module2,F[6]L,IN&lt;BR /&gt;
      09:04:01.484,module2,F[6]L,OUT&lt;BR /&gt;
      09:04:01.485,module2,F[6]L,OUT&lt;BR /&gt;
      09:04:01.488,module50,F[18]L,IN&lt;BR /&gt;
      09:04:01.489,module52,F[20]L,IN&lt;BR /&gt;
      09:04:01.490,module53,F[18]L,OUT&lt;BR /&gt;
      09:04:01.491,module52,F[20]L,OUT"&lt;/P&gt;

&lt;P&gt;result:&lt;BR /&gt;
 09:04:01.488,module50,F[18]L,IN&lt;BR /&gt;
 09:04:01.490,module53,F[18]L,OUT&lt;/P&gt;

&lt;P&gt;expected result:&lt;BR /&gt;
09:04:01.483,module2,F[6]L,IN&lt;BR /&gt;
09:04:01.488,module50,F[18]L,IN&lt;BR /&gt;
09:04:01.490,module53,F[18]L,OUT&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 14:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/expect-value/m-p/470381#M192140</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-30T14:26:02Z</dc:date>
    </item>
  </channel>
</rss>

