kapilt: this doesn't actually make a metrics filter work, implementing a unit test will demonstrate that
diff --git a/c7n/resources/cw.py b/c7n/resources/cw.py
index b0ccf6e14..6c8655a52 100644
--- a/c7n/resources/cw.py
+++ b/c7n/resources/cw.py
@@ -176,6 +176,13 @@ class LogGroup(QueryResourceManager):
         return [r['arn'][:-2] for r in resources]
 
 
+@LogGroup.filter_registry.register('metrics')
+class LogGroupMetrics(MetricsFilter):
+
+    def get_dimensions(self, resource):
+        return [{'Name': 'LogGroupName', 'Value': resource['logGroupName']}]
+
+
 @LogGroup.action_registry.register('retention')
 class Retention(BaseAction):
     """Action to set the retention period (in days) for CloudWatch log groups

AWS-Metric filter on log-group is failing
I  am writing a policy to  with  metric  filter on log groups. The  policy is
```
policies:   
    - name: logs-incoming-bytes
      resource: log-group
      comment: |
        Ingested logs size 
      filters:
        - type: metrics
          namespace: AWS/Logs
          name: IncomingBytes          
          value: 0         
          statistics: Sum
```
This is failing with below error,

```
2020-07-09 17:21:54,198: custodian.filters:WARNING CW Retrieval error: 'LogGroupName'
2020-07-09 17:21:54,199: custodian.policy:INFO policy:logs-incoming-bytes resource:log-group region:us-east-1 count:0 time:4.81
```
Please look into this.

Background (please complete the following information):**
 - OS: OSX 10.15.5
 - Python Version: python 3.7.7
 - Custodian Version: 0.8.44.2
 - Tool Version: [if applicable]
 - Cloud Provider: aws
 

diff --git a/tests/data/placebo/test_log_group_metric/logs.DescribeLogGroups_1.json b/tests/data/placebo/test_log_group_metric/logs.DescribeLogGroups_1.json
new file mode 100644
index 000000000..fcbcc6f18
--- /dev/null
+++ b/tests/data/placebo/test_log_group_metric/logs.DescribeLogGroups_1.json
@@ -0,0 +1,22 @@
+{
+    "status_code": 200,
+    "data": {
+        "logGroups": [
+            {
+                "logGroupName": "/aws/lambda/myIOTFunction",
+                "creationTime": 6441605581965,
+                "metricFilterCount": 0,
+                "arn": "arn:aws:logs:us-west-2:644160558196:log-group:/aws/lambda/myIOTFunction:*",
+                "storedBytes": 857324
+            },
+            {
+                "logGroupName": "devlog",
+                "creationTime": 6441605581968,
+                "metricFilterCount": 0,
+                "arn": "arn:aws:logs:us-west-2:644160558196:log-group:devlog:*",
+                "storedBytes": 0
+            }
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_log_group_metric/monitoring.GetMetricStatistics_1.json b/tests/data/placebo/test_log_group_metric/monitoring.GetMetricStatistics_1.json
new file mode 100644
index 000000000..5478a41ce
--- /dev/null
+++ b/tests/data/placebo/test_log_group_metric/monitoring.GetMetricStatistics_1.json
@@ -0,0 +1,23 @@
+{
+    "status_code": 200,
+    "data": {
+        "Label": "IncomingBytes",
+        "Datapoints": [
+            {
+                "Timestamp": {
+                    "hour": 11, 
+                    "__class__": "datetime", 
+                    "month": 8, 
+                    "second": 0, 
+                    "microsecond": 0, 
+                    "year": 2016, 
+                    "day": 8, 
+                    "minute": 46
+                }, 
+                "Average": 107.0, 
+                "Unit": "Bytes"
+            }  
+        ],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/data/placebo/test_log_group_metric/tagging.GetResources_1.json b/tests/data/placebo/test_log_group_metric/tagging.GetResources_1.json
new file mode 100644
index 000000000..8b704d185
--- /dev/null
+++ b/tests/data/placebo/test_log_group_metric/tagging.GetResources_1.json
@@ -0,0 +1,8 @@
+{
+    "status_code": 200,
+    "data": {
+        "PaginationToken": "",
+        "ResourceTagMappingList": [],
+        "ResponseMetadata": {}
+    }
+}
\ No newline at end of file
diff --git a/tests/test_cwl.py b/tests/test_cwl.py
index ff2525d45..8ba8ec007 100644
--- a/tests/test_cwl.py
+++ b/tests/test_cwl.py
@@ -161,3 +161,20 @@ class LogGroupTest(BaseTest):
         self.assertEqual(
             results[0]['kmsKeyId'],
             'arn:aws:kms:us-west-2:644160558196:key/6f13fc53-8da0-46f2-9c69-c1f9fbf471d7')
+
+    def test_metrics(self):
+        session_factory = self.replay_flight_data('test_log_group_metric')
+        p = self.load_policy(
+            {'name': 'metric-log-group',
+             'resource': 'log-group',
+             'filters': [
+                 {"logGroupName": "/aws/lambda/myIOTFunction"},
+                 {"type": "metrics",
+                  "name": "IncomingBytes",
+                  "value": 1,
+                  "op": "greater-than"}]},
+            config={'region': 'us-west-2'},
+            session_factory=session_factory)
+        resources = p.run()
+        self.assertEqual(len(resources), 1)
+        self.assertIn('c7n.metrics', resources[0])

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock
apt-get update apt-get install -y gcc python3-dev
3.8
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
apipkg==1.5
appdirs==1.4.4
argcomplete==1.11.1
attrs==19.3.0
aws-xray-sdk==2.6.0
bleach==3.1.5
boto3==1.14.16
botocore==1.17.16
-e git+https://github.com/cloud-custodian/cloud-custodian.git@3736c896bb1fe52537d21b7743d52d5481653807#egg=c7n
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
colorama==0.4.3
coverage==5.2
cryptography==2.9.2
distlib==0.3.1
docutils==0.15.2
exceptiongroup==1.2.2
execnet==1.7.1
filelock==3.0.12
flake8==3.8.3
future==0.18.2
idna==2.10
importlib-metadata==1.7.0
iniconfig==2.1.0
jeepney==0.4.3
jmespath==0.10.0
jsonpatch==1.26
jsonpickle==1.4.1
jsonpointer==2.0
jsonschema==3.2.0
keyring==21.2.1
mccabe==0.6.1
mock==4.0.2
more-itertools==8.4.0
multidict==4.7.6
packaging==20.4
pkginfo==1.5.0.1
placebo==0.9.0
pluggy==1.5.0
psutil==5.7.0
py==1.9.0
pycodestyle==2.6.0
pycparser==2.20
pyflakes==2.2.0
Pygments==2.6.1
pyparsing==2.4.7
pyrsistent==0.16.0
pytest==8.3.5
pytest-cov==2.10.0
pytest-forked==1.2.0
pytest-mock==3.14.0
pytest-sugar==0.9.3
pytest-xdist==1.32.0
python-dateutil==2.8.1
PyYAML==5.3.1
readme-renderer==26.0
requests==2.24.0
requests-toolbelt==0.9.1
rfc3986==1.4.0
s3transfer==0.3.3
SecretStorage==3.1.2
six==1.15.0
tabulate==0.8.7
termcolor==1.1.0
toml==0.10.1
tomli==2.2.1
tox==3.16.1
tqdm==4.47.0
twine==3.2.0
urllib3==1.25.9
vcrpy==4.0.2
virtualenv==20.0.25
wcwidth==0.2.5
webencodings==0.5.1
wrapt==1.12.1
yarl==1.4.2
zipp==3.1.0

name: cloud-custodian
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=24.2=py38h06a4308_0
  - python=3.8.20=he870216_0
  - readline=8.2=h5eee18b_0
  - setuptools=75.1.0=py38h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.44.0=py38h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - apipkg==1.5
      - appdirs==1.4.4
      - argcomplete==1.11.1
      - attrs==19.3.0
      - aws-xray-sdk==2.6.0
      - bleach==3.1.5
      - boto3==1.14.16
      - botocore==1.17.16
      - c7n==0.9.4
      - certifi==2020.6.20
      - cffi==1.14.0
      - chardet==3.0.4
      - colorama==0.4.3
      - coverage==5.2
      - cryptography==2.9.2
      - distlib==0.3.1
      - docutils==0.15.2
      - exceptiongroup==1.2.2
      - execnet==1.7.1
      - filelock==3.0.12
      - flake8==3.8.3
      - future==0.18.2
      - idna==2.10
      - importlib-metadata==1.7.0
      - iniconfig==2.1.0
      - jeepney==0.4.3
      - jmespath==0.10.0
      - jsonpatch==1.26
      - jsonpickle==1.4.1
      - jsonpointer==2.0
      - jsonschema==3.2.0
      - keyring==21.2.1
      - mccabe==0.6.1
      - mock==4.0.2
      - more-itertools==8.4.0
      - multidict==4.7.6
      - packaging==20.4
      - pkginfo==1.5.0.1
      - placebo==0.9.0
      - pluggy==1.5.0
      - psutil==5.7.0
      - py==1.9.0
      - pycodestyle==2.6.0
      - pycparser==2.20
      - pyflakes==2.2.0
      - pygments==2.6.1
      - pyparsing==2.4.7
      - pyrsistent==0.16.0
      - pytest==8.3.5
      - pytest-cov==2.10.0
      - pytest-forked==1.2.0
      - pytest-mock==3.14.0
      - pytest-sugar==0.9.3
      - pytest-xdist==1.32.0
      - python-dateutil==2.8.1
      - pyyaml==5.3.1
      - readme-renderer==26.0
      - requests==2.24.0
      - requests-toolbelt==0.9.1
      - rfc3986==1.4.0
      - s3transfer==0.3.3
      - secretstorage==3.1.2
      - six==1.15.0
      - tabulate==0.8.7
      - termcolor==1.1.0
      - toml==0.10.1
      - tomli==2.2.1
      - tox==3.16.1
      - tqdm==4.47.0
      - twine==3.2.0
      - urllib3==1.25.9
      - vcrpy==4.0.2
      - virtualenv==20.0.25
      - wcwidth==0.2.5
      - webencodings==0.5.1
      - wrapt==1.12.1
      - yarl==1.4.2
      - zipp==3.1.0
prefix: /opt/conda/envs/cloud-custodian

tests/test_cwl.py::LogGroupTest::test_metrics
tests/test_cwl.py::LogGroupTest::test_age_normalize tests/test_cwl.py::LogGroupTest::test_cross_account tests/test_cwl.py::LogGroupTest::test_delete tests/test_cwl.py::LogGroupTest::test_encrypt tests/test_cwl.py::LogGroupTest::test_last_write tests/test_cwl.py::LogGroupTest::test_log_group_delete_error tests/test_cwl.py::LogGroupTest::test_retention
c7n/resources/cw.py
c7n/resources/cw.py