<?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: Calculating data throughput for cloud in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682390#M233137</link>
    <description>&lt;P&gt;apologies for all the parenthesis, I was just trying to keep things straight in my head. There's definitely a better way to frame the query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried what you suggested with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(id.resp_h="front end",resp_bytes,0)&lt;/LI-CODE&gt;&lt;P&gt;even simplifying the expression to filter on one ip address at a time gives an error. trying to use it like this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="zeek" source="conn.log"
((id.orig_h IN `front end`) AND NOT (id.resp_h IN `backend`)) OR 
((id.resp_h IN `front end`) AND NOT (id.orig_h IN `backend`))
| fields orig_bytes, resp_bytes
| eval terabytes=((if(id.resp_h=192.168.0.1,resp_bytes,0))+(if(id.orig_h=192.168.0.1,orig_bytes,0)))/1024/1024/1024/1024
| stats sum (terabytes)&lt;/LI-CODE&gt;&lt;P&gt;I just get an error back from splunk.&amp;nbsp;&lt;BR /&gt;Error in EvalCommand: the number 192.168.0.1 is invalid&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2024 13:34:12 GMT</pubDate>
    <dc:creator>taijusoup64</dc:creator>
    <dc:date>2024-03-29T13:34:12Z</dc:date>
    <item>
      <title>Calculating data throughput for cloud</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682335#M233114</link>
      <description>&lt;P&gt;I'm trying to calculate the data throughput for a cloud computing solution that will be charging based on outgoing data throughput.&lt;/P&gt;
&lt;P&gt;We're collecting on the link using security onion and forwarding those zeek logs to our splunk instance.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="zeek" source="conn.log"
((id.orig_h IN `front end`) AND NOT (id.resp_h IN `backend`)) OR 
((id.resp_h IN `front end`) AND NOT (id.orig_h IN `backend`))
| fields orig_bytes, resp_bytes
| eval terabytes=(((((resp_bytes+orig_bytes)/1024)/1024)/1024)/1024)
| stats sum (terabytes)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This gives me traffic throughput in and out of the network for external connections however what I need is to calculate orig_bytes only when the id.orig_h is my `frontend` and resp_bytes when id.resp_h is `frontend`.&lt;BR /&gt;I can get them separately by just doing two different searches and then adding the results up by hand. But I'm sure theres a way to do what I want to in one search using some sort of conditional. I've tried using where and eval if but I'm just not skilled enough it seems.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 20:16:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682335#M233114</guid>
      <dc:creator>taijusoup64</dc:creator>
      <dc:date>2024-03-28T20:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating data throughput for cloud</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682362#M233134</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243846"&gt;@taijusoup64&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;let me understand: you want to calculate bytes only when:&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;id.orig_h="frontend" AND id.resp_h="frontend", is this correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in this case add the condition to the eval statement:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="zeek" source="conn.log"
((id.orig_h IN `front end`) AND NOT (id.resp_h IN `backend`)) OR 
((id.resp_h IN `front end`) AND NOT (id.orig_h IN `backend`))
| fields orig_bytes, resp_bytes
| eval terabytes=((if(id.resp_h="front end",resp_bytes,0))+(if(id.orig_h="front end",orig_bytes,0)))/1024/1024/1024/1024
| stats sum (terabytes)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;why did you used all that parenthesis?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 06:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682362#M233134</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-29T06:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating data throughput for cloud</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682390#M233137</link>
      <description>&lt;P&gt;apologies for all the parenthesis, I was just trying to keep things straight in my head. There's definitely a better way to frame the query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried what you suggested with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(id.resp_h="front end",resp_bytes,0)&lt;/LI-CODE&gt;&lt;P&gt;even simplifying the expression to filter on one ip address at a time gives an error. trying to use it like this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="zeek" source="conn.log"
((id.orig_h IN `front end`) AND NOT (id.resp_h IN `backend`)) OR 
((id.resp_h IN `front end`) AND NOT (id.orig_h IN `backend`))
| fields orig_bytes, resp_bytes
| eval terabytes=((if(id.resp_h=192.168.0.1,resp_bytes,0))+(if(id.orig_h=192.168.0.1,orig_bytes,0)))/1024/1024/1024/1024
| stats sum (terabytes)&lt;/LI-CODE&gt;&lt;P&gt;I just get an error back from splunk.&amp;nbsp;&lt;BR /&gt;Error in EvalCommand: the number 192.168.0.1 is invalid&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 13:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682390#M233137</guid>
      <dc:creator>taijusoup64</dc:creator>
      <dc:date>2024-03-29T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating data throughput for cloud</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682464#M233153</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243846"&gt;@taijusoup64&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;use always quotes in the eval condition:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="zeek" source="conn.log"
((id.orig_h IN `front end`) AND NOT (id.resp_h IN `backend`)) OR 
((id.resp_h IN `front end`) AND NOT (id.orig_h IN `backend`))
| fields orig_bytes, resp_bytes
| eval terabytes=((if(id.resp_h="192.168.0.1",resp_bytes,0))+(if(id.orig_h="192.168.0.1",orig_bytes,0)))/1024/1024/1024/1024
| stats sum (terabytes)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2024 07:27:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculating-data-throughput-for-cloud/m-p/682464#M233153</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-03-30T07:27:25Z</dc:date>
    </item>
  </channel>
</rss>

