[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-06-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16033135#comment-16033135
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user asfgit closed the pull request at:

https://github.com/apache/metron/pull/570


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-06-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16033128#comment-16033128
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user ottobackwards commented on the issue:

https://github.com/apache/metron/pull/570
  
+1, ran through steps.  Thanks for the contribution!



> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-06-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16033086#comment-16033086
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen commented on the issue:

https://github.com/apache/metron/pull/570
  
Please take a look-see.  I'd like to get this fix in.  Travis CI has passed.


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-06-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16033027#comment-16033027
 ] 

ASF GitHub Bot commented on METRON-937:
---

GitHub user nickwallen reopened a pull request:

https://github.com/apache/metron/pull/570

METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

## Changes

* I have altered Pycapa so that it can consume messages from either the 
beginning, end or the previously stored offsets of a topic.  This can be done 
using the `-o` or `--kafka-offset` flag that can be either `begin`, `end`, or 
`stored`.  This defaults to `end`.
* Added additional information when using the `--pretty-print` flag.  It 
will now show the partition and offset for a packet, both on the producer-side 
(sending packets to Kafka) or the consumer-side (receiving packets from Kafka).

## Testing

1. Install Pycapa.

1. Launch a Kafka Broker on your localhost.  For example, using Kafka 
installed via Brew on my Mac.

   ```
   export KAFKA_HOME=/usr/local/Cellar/kafka/0.10.1.1/
   export KAFKA_CONF=$KAFKA_HOME/libexec/config
   zookeeper-server-start $KAFKA_CONF/zookeeper.properties
   kafka-server-start $KAFKA_CONF/server.properties
   ```

1. Produce some packets.  Assumes you're actively using `en0` and Kafka is 
at `localhost:9092`.  Let it run until it completes and captures 50 packets.

```
 pycapa --producer \
--interface en0 \
--kafka-broker localhost:9092 \
--kafka-topic pcap \
--max-packets 50
```

1. Run the consumer. The consumer will not consume any packets.  It starts 
from the end of the topic, by default, and since there are no active producers, 
there is nothing new to consume.

```
pycapa --consumer \
--kafka-broker localhost:9092 \
--kafka-topic pcap
--pretty-print 1
```

1. Run the consumer again, but start from the beginning of the topic.  You 
should be able to consume all 50 packets.

```
pycapa --consumer \
--kafka-broker localhost:9092 \
--kafka-topic pcap
--pretty-print 1
--kafka-offset begin
```


## Pull Request Checklist

- [x] Is there a JIRA ticket associated with this PR? If not one needs to 
be created at [Metron 
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
 
- [x] Does your PR title start with METRON- where  is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
- [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
- [x] Have you included steps to reproduce the behavior or problem that is 
being changed or addressed?
- [x] Have you included steps or a guide to how the change may be verified 
and tested manually?
- [x] Have you ensured that the full suite of tests and checks have been 
executed in the root incubating-metron folder via:
- [x] Have you written or updated unit tests and or integration tests to 
verify your changes?
- [x] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [x] Have you verified the basic functionality of the build by building 
and running locally with Vagrant full-dev environment or the equivalent?
- [x] Have you ensured that format looks appropriate for the output in 
which it is rendered by building and verifying the site-book? If not then run 
the following commands and the verify changes via 
`site-book/target/site/index.html`:



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/nickwallen/metron METRON-937

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/metron/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #570


commit 23af8e9535ee396ce1a722b51672d4e8a9a69b4d
Author: Nick Allen 
Date:   2017-05-05T21:51:05Z

METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets




> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the 

[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-06-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16033026#comment-16033026
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen commented on the issue:

https://github.com/apache/metron/pull/570
  
Travis is my friend


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-06-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16033025#comment-16033025
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen closed the pull request at:

https://github.com/apache/metron/pull/570


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-05-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16013926#comment-16013926
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen closed the pull request at:

https://github.com/apache/metron/pull/570


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-05-14 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16009875#comment-16009875
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen commented on the issue:

https://github.com/apache/metron/pull/570
  
Travis

```
Running org.apache.metron.pcap.integration.PcapTopologyIntegrationTest
...
ERROR ReadClusterState:345 - Error trying to shutdown workers in 
Thread[SLOT_1024,5,main]
java.lang.IllegalStateException: It took over 6ms to shut down slot 
Thread[SLOT_1024,5,main]
...
ERROR FluxTopologyComponent:166 - Storm slots didn't shut down entirely 
cleanly *sigh*.  I gave them the old one-two-skadoo and killed the slots with 
prejudice.  If tests fail, we'll have to find a better way of killing them.
java.lang.IllegalStateException: It took over 6ms to shut down slot 
Thread[SLOT_1024,5,main]
at 
org.apache.storm.daemon.supervisor.ReadClusterState$1.call(ReadClusterState.java:294)
...

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 179.503 sec 
<<< FAILURE! - in org.apache.metron.pcap.integration.PcapTopologyIntegrationTest

testTimestampInPacket(org.apache.metron.pcap.integration.PcapTopologyIntegrationTest)
  Time elapsed: 71.681 sec  <<< ERROR!
java.lang.RuntimeException: Too many retries: 11
```


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-05-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002927#comment-16002927
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen commented on the issue:

https://github.com/apache/incubator-metron/pull/570
  
travis!

```
---
 T E S T S
---
Running org.apache.metron.pcap.integration.PcapTopologyIntegrationTest
Formatting using clusterid: testClusterID
Processing: ip_dst_addr => 207.28.210.1
Processing: protocol => foo
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Processing: ip_dst_port => 22
Ended
2017-05-09 14:39:20 ERROR ReadClusterState:345 - Error trying to shutdown 
workers in Thread[SLOT_1027,5,main]
java.lang.IllegalStateException: It took over 6ms to shut down slot 
Thread[SLOT_1027,5,main]
at 
org.apache.storm.daemon.supervisor.ReadClusterState$1.call(ReadClusterState.java:294)
at 
org.apache.storm.daemon.supervisor.ReadClusterState$1.call(ReadClusterState.java:292)
at 
org.apache.storm.daemon.supervisor.ReadClusterState$3.call(ReadClusterState.java:307)
at 
org.apache.storm.daemon.supervisor.ReadClusterState$3.call(ReadClusterState.java:304)
at 
org.apache.storm.daemon.supervisor.ReadClusterState.shutdownAllWorkers(ReadClusterState.java:333)
at 
org.apache.storm.daemon.supervisor.Supervisor.shutdownAllWorkers(Supervisor.java:330)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at 
org.apache.storm.testing$kill_local_storm_cluster.invoke(testing.clj:204)
at org.apache.storm.LocalCluster$_shutdown.invoke(LocalCluster.clj:66)
at org.apache.storm.LocalCluster.shutdown(Unknown Source)
at 
org.apache.metron.integration.components.FluxTopologyComponent.stop(FluxTopologyComponent.java:159)
```


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-05-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002928#comment-16002928
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen closed the pull request at:

https://github.com/apache/incubator-metron/pull/570


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-05-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002740#comment-16002740
 ] 

ASF GitHub Bot commented on METRON-937:
---

GitHub user nickwallen reopened a pull request:

https://github.com/apache/incubator-metron/pull/570

METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets

## Changes

* I have altered Pycapa so that it can consume messages from either the 
beginning, end or the previously stored offsets of a topic.  This can be done 
using the `-o` or `--kafka-offset` flag that can be either `begin`, `end`, or 
`stored`.  This defaults to `end`.
* Added additional information when using the `--pretty-print` flag.  It 
will now show the partition and offset for a packet, both on the producer-side 
(sending packets to Kafka) or the consumer-side (receiving packets from Kafka).

## Testing

1. Install Pycapa.

1. Launch a Kafka Broker on your localhost.  For example, using Kafka 
installed via Brew on my Mac.

   ```
   export KAFKA_HOME=/usr/local/Cellar/kafka/0.10.1.1/
   export KAFKA_CONF=$KAFKA_HOME/libexec/config
   zookeeper-server-start $KAFKA_CONF/zookeeper.properties
   kafka-server-start $KAFKA_CONF/server.properties
   ```

1. Produce some packets.  Assumes you're actively using `en0` and Kafka is 
at `localhost:9092`.  Let it run until it completes and captures 50 packets.

```
 pycapa --producer \
--interface en0 \
--kafka-broker localhost:9092 \
--kafka-topic pcap \
--max-packets 50
```

1. Run the consumer. The consumer will not consume any packets.  It starts 
from the end of the topic, by default, and since there are no active producers, 
there is nothing new to consume.

```
pycapa --consumer \
--kafka-broker localhost:9092 \
--kafka-topic pcap
--pretty-print 1
```

1. Run the consumer again, but start from the beginning of the topic.  You 
should be able to consume all 50 packets.

```
pycapa --consumer \
--kafka-broker localhost:9092 \
--kafka-topic pcap
--pretty-print 1
--kafka-offset begin
```


## Pull Request Checklist

- [x] Is there a JIRA ticket associated with this PR? If not one needs to 
be created at [Metron 
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
 
- [x] Does your PR title start with METRON- where  is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
- [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
- [x] Have you included steps to reproduce the behavior or problem that is 
being changed or addressed?
- [x] Have you included steps or a guide to how the change may be verified 
and tested manually?
- [x] Have you ensured that the full suite of tests and checks have been 
executed in the root incubating-metron folder via:
- [x] Have you written or updated unit tests and or integration tests to 
verify your changes?
- [x] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [x] Have you verified the basic functionality of the build by building 
and running locally with Vagrant full-dev environment or the equivalent?
- [x] Have you ensured that format looks appropriate for the output in 
which it is rendered by building and verifying the site-book? If not then run 
the following commands and the verify changes via 
`site-book/target/site/index.html`:



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/nickwallen/incubator-metron METRON-937

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-metron/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #570


commit 23af8e9535ee396ce1a722b51672d4e8a9a69b4d
Author: Nick Allen 
Date:   2017-05-05T21:51:05Z

METRON-937 Pycapa Consume Messages from Begin, End, or Stored Offsets




> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to 

[jira] [Commented] (METRON-937) Pycapa - Consume Messages from Begin, End, or Stored Offsets

2017-05-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/METRON-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002738#comment-16002738
 ] 

ASF GitHub Bot commented on METRON-937:
---

Github user nickwallen commented on the issue:

https://github.com/apache/incubator-metron/pull/570
  
travis!

```
Running org.apache.metron.parsers.integration.YafIntegrationTest
Running Sample Data Validation on sensorType yaf
2017-05-09 13:31:23 ERROR ParserTopologyComponent:114 - Storm slots didn't 
shut down entirely cleanly *sigh*.  I gave them the old one-two-skadoo and 
killed the slots with prejudice.  If tests fail, we'll have to find a better 
way of killing them.
java.lang.IllegalStateException: It took over 6ms to shut down slot 
Thread[SLOT_1024,5,main]
```


> Pycapa - Consume Messages from Begin, End, or Stored Offsets
> 
>
> Key: METRON-937
> URL: https://issues.apache.org/jira/browse/METRON-937
> Project: Metron
>  Issue Type: Improvement
>Reporter: Nick Allen
>Assignee: Nick Allen
>
> Enable Pycapa to consume packets from either the beginning, ending or stored 
> offsets for a topic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)